Krzysztof Parzyszek via llvm-dev
2016-Jan-08 17:53 UTC
[llvm-dev] TableGen error message: top-level forms in instruction pattern should have void types
On 1/7/2016 5:54 PM, Phil Tomson wrote:> I got it to compile by changing to: > 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 GPRC:$dst), > (ins GPRC:$spoff, GPRC:$addr), > "! RELADDR $spoff, $dst", > [(set GPRC:$dst, (XSTGRELADDR > GPRC:$addr, GPRC:$spoff))]>; > } > > ...though I'm not entirely sure if it's going to do what I want.If you want the final address to be put in the same register as the input, you can add a constraint "$dst = $addr": let Uses= [GRP] in { def RelAddr : XSTGPseudo<(outs GPRC:$dst), (ins GPRC:$spoff, GPRC:$addr), "! RELADDR $spoff, $dst", [(set GPRC:$dst, (XSTGRELADDR GPRC:$addr, GPRC:$spoff))], "$dst = $addr">; } -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Phil Tomson via llvm-dev
2016-Jan-12 17:30 UTC
[llvm-dev] TableGen error message: top-level forms in instruction pattern should have void types
On Fri, Jan 8, 2016 at 9:53 AM, Krzysztof Parzyszek <kparzysz at codeaurora.org> wrote:> On 1/7/2016 5:54 PM, Phil Tomson wrote: > >> I got it to compile by changing to: >> 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 GPRC:$dst), >> (ins GPRC:$spoff, GPRC:$addr), >> "! RELADDR $spoff, $dst", >> [(set GPRC:$dst, (XSTGRELADDR >> GPRC:$addr, GPRC:$spoff))]>; >> } >> >> ...though I'm not entirely sure if it's going to do what I want. >> > > If you want the final address to be put in the same register as the input, > you can add a constraint "$dst = $addr": > > let Uses= [GRP] in { > def RelAddr : XSTGPseudo<(outs GPRC:$dst), > (ins GPRC:$spoff, GPRC:$addr), > "! RELADDR $spoff, $dst", > [(set GPRC:$dst, (XSTGRELADDR GPRC:$addr, GPRC:$spoff))], > "$dst = $addr">; > > } >Our XSTGPseudo constructor doesn't allow for that. Is there a way to add this kind of constraing after the definition? Phil> > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160112/f9a938ef/attachment.html>
Krzysztof Parzyszek via llvm-dev
2016-Jan-12 17:36 UTC
[llvm-dev] TableGen error message: top-level forms in instruction pattern should have void types
On 1/12/2016 11:30 AM, Phil Tomson wrote:> > Our XSTGPseudo constructor doesn't allow for that. Is there a way to add > this kind of constraing after the definition?After the definition, no. Could you try this instead? let Constraints = "$dst = $addr", Uses= [GRP] in { def RelAddr : XSTGPseudo<(outs GPRC:$dst), (ins GPRC:$spoff, GPRC:$addr), "! RELADDR $spoff, $dst", [(set GPRC:$dst, (XSTGRELADDR GPRC:$addr, GPRC:$spoff))]>; } -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation