Phil Tomson via llvm-dev
2016-Jan-13 17:59 UTC
[llvm-dev] Type inference in TableGen DAG patterns
Given the following definitions: def SDT_XSTGMVINI : SDTypeProfile<1, 1, [SDTCisInt<0>]>; def XSTGMVINI : SDNode<"XSTGISD::MVINI", SDT_XSTGMVINI>; def SDT_RELADDR : SDTypeProfile<1, 2, []>; def XSTGRELADDR : SDNode<"XSTGISD::RELADDR", SDT_RELADDR>; let Constraints = "$dst = $addr", Uses= [GRP] in { def RelAddr : XSTGPseudo< (outs GPRC:$dst), //(ins GPRC:$spoff, GPRC:$addr), (ins i64imm:$spoff, i64imm:$addr), "! RELADDR $spoff, $dst", [(set GPRC:$dst, (XSTGRELADDR i64:$spoff, (XSTGMVINI i64:$addr) ) )]>; } When I compile I get: XSTGInstrInfo.td:903:3: error: In RelAddr: Could not infer all types in pattern! def RelAddr : XSTGPseudo< (outs GPRC:$dst), ^ I thought that perhaps I could explicitly add the type in like this: let Constraints = "$dst = $addr", Uses= [GRP] in { def RelAddr : XSTGPseudo< (outs GPRC:$dst), //(ins GPRC:$spoff, GPRC:$addr), (ins i64imm:$spoff, i64imm:$addr), "! RELADDR $spoff, $dst", [(set GPRC:$dst, (XSTGRELADDR i64:$spoff, i64:(XSTGMVINI i64:$addr) ) )]>; } But that causes another problem: XSTGInstrInfo.td:908:73: error: expected variable name in dag literal i64:(XSTGMVINI i64:$addr) ^ How can this be resolved? Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160113/fc307bad/attachment-0001.html>
Krzysztof Parzyszek via llvm-dev
2016-Jan-13 18:26 UTC
[llvm-dev] Type inference in TableGen DAG patterns
On 1/13/2016 11:59 AM, Phil Tomson via llvm-dev wrote:> > XSTGInstrInfo.td:908:73: error: expected variable name in dag literal > > i64:(XSTGMVINI i64:$addr) > ^ > How can this be resolved?Try (i64 (XSTGMVINI ...)) -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Phil Tomson via llvm-dev
2016-Jan-13 20:04 UTC
[llvm-dev] Type inference in TableGen DAG patterns
Thanks, that worked. So that's basically a cast, then? I have another question about expanding that pseudo op, but I'll post it separately. Phil On Wed, Jan 13, 2016 at 10:26 AM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 1/13/2016 11:59 AM, Phil Tomson via llvm-dev wrote: > >> >> XSTGInstrInfo.td:908:73: error: expected variable name in dag literal >> >> i64:(XSTGMVINI i64:$addr) >> ^ >> How can this be resolved? >> > > Try (i64 (XSTGMVINI ...)) > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160113/7825d68f/attachment.html>
Possibly Parallel Threads
- Expanding a PseudoOp and accessing the DAG
- Expanding a PseudoOp and accessing the DAG
- TableGen error message: top-level forms in instruction pattern should have void types
- TableGen error message: top-level forms in instruction pattern should have void types
- TableGen error message: top-level forms in instruction pattern should have void types