Phil Tomson via llvm-dev
2016-Jan-07 19:55 UTC
[llvm-dev] TableGen error message: top-level forms in instruction pattern should have void types
I'm trying to figure out what this error message means: error: In RelAddr: Top-level forms in instruction pattern should have void types The definitions it's complaining about: //===----------------------------------------------------------------------===// // RELADDR //===----------------------------------------------------------------------===// def SDT_RELADDR : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<0, 1>]>; def XSTGRELADDR : SDNode<"XSTGISD::RELADDR", SDT_RELADDR>; let Uses= [GRP] in { def RelAddr : XSTGPseudo< (outs), (ins GPRC:$spoff, GPRC:$dst), "! RELADDR $spoff, $dst", [(XSTGRELADDR GPRC:$spoff, GPRC: $dst)]>; } (specifically that 'def RelAddr' line) If I change it to have an empty pattern match like this: let Uses= [GRP] in { def RelAddr : XSTGPseudo< (outs), (ins GPRC:$spoff, GPRC:$dst), "! RELADDR $spoff, $dst", []>; } It will compile, but without the pattern it's not a very useful def. Any suggestions? I have other XSGTGPseudo definitions in the .td file which are similar which do compile, like this: def SDT_XSTGEhRet : SDTypeProfile<0, 2, [SDTCisInt<0>, SDTCisPtrTy<1>]>; def XSTGEhReturn : SDNode<"XSTGISD::EH_Return", SDT_XSTGEhRet, [SDNPHasChain, SDNPOptInGlue]>; // // EhReturn takes the place of regular return instruction // but takes two arguments (R2, R3) which are used for storing // the offset and return address respectively. // let Uses = [R2, R3], isTerminator = 1, isReturn = 1, isBarrier = 1 in { def EhReturn : XSTGPseudo< (outs), (ins GPRC:$spoff, GPRC:$dst), "! EH_RETURN $spoff, $dst", [(XSTGEhReturn GPRC:$spoff, GPRC:$dst)]>; } Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160107/57b58345/attachment.html>
Krzysztof Parzyszek via llvm-dev
2016-Jan-07 20:21 UTC
[llvm-dev] TableGen error message: top-level forms in instruction pattern should have void types
On 1/7/2016 1:55 PM, Phil Tomson via llvm-dev wrote:> > let Uses= [GRP] in { > def RelAddr : XSTGPseudo< (outs), > (ins GPRC:$spoff, GPRC:$dst), > "! RELADDR $spoff, $dst", > [(XSTGRELADDR GPRC:$spoff, GPRC: > $dst)]>; > } > >Remove the "dst" operand from XSTGRELADDR and try something like [(set GPRC:$dst, (XSTGRELADDR GPRC:$spoff))] -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Phil Tomson via llvm-dev
2016-Jan-07 21:25 UTC
[llvm-dev] TableGen error message: top-level forms in instruction pattern should have void types
On Thu, Jan 7, 2016 at 12:21 PM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 1/7/2016 1:55 PM, Phil Tomson via llvm-dev wrote: > >> >> let Uses= [GRP] in { >> def RelAddr : XSTGPseudo< (outs), >> (ins GPRC:$spoff, GPRC:$dst), >> "! RELADDR $spoff, $dst", >> [(XSTGRELADDR GPRC:$spoff, GPRC: >> $dst)]>; >> } >> >> >> > Remove the "dst" operand from XSTGRELADDR and try something like > [(set GPRC:$dst, (XSTGRELADDR GPRC:$spoff))] > >That's better, but now I get: XSTGInstrInfo.td:902:3: error: In RelAddr: XSTGRELADDR node requires exactly 2 operands! Which makes some sense as XSTGRELADDR is defined as: def SDT_RELADDR : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<0, 1>]>; def XSTGRELADDR : SDNode<"XSTGISD::RELADDR", SDT_RELADDR>; Phil -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/20160107/9303b8a6/attachment.html>