<div dir="ltr">Hi Martin,<div><br></div><div>Pseudo CALLSEQ_START was changed in r302527, commit message contains details on the changes.</div><div>However CALLSEQ_END was not modified. If your made changes to ADJCALLSTACKUP to add</div><div>additional argument, that may result in error.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">Thanks,<br>--Serge<br></div></div>
<br><div class="gmail_quote">2017-09-15 19:09 GMT+07:00 Martin J. O'Riordan via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi LLVM-Devs,<br>
<br>
I have managed to complete updating our sources from LLVM v4.0 to v5.0, but<br>
I am getting selection errors for 'callseq_end'. I am aware that the<br>
'ADJCALLSTACKUP' and 'ADJCALLSTACKDOWN' patterns have changed, and have<br>
added an additional argument to the TD descriptions for these.<br>
<br>
There are interactions with 'ISD::CALL' and 'ISD::RET_FLAG', but so far as I<br>
can tell I have revised these in the same way as the in-tree targets have<br>
adjusted their sources.<br>
<br>
The error I am seeing is:<br>
<br>
fatal error: error in backend: Cannot select: 0x15c9bbe00: ch,glue =<br>
callseq_end 0x15c9bbd98, TargetConstant:i32<0>, TargetGlobalAddress:i32<void<br>
(i8*, i32, i8*, i8*)* @__assert_func> 0, 0x15c9bbd98:1<br>
0x15c9bb920: i32 = TargetConstant<0><br>
0x15c9bb8b8: i32 = TargetGlobalAddress<void (i8*, i32, i8*, i8*)*<br>
@__assert_func> 0<br>
0x15c9bbd98: ch,glue = MYISD::CALL 0x15c9bbcc8,<br>
TargetGlobalAddress:i32<void (i8*, i32, i8*, i8*)* @__assert_func> 0,<br>
Register:i32 %I18, Register:i32 %I17, Register:i32 %I16, Register:i32 %I15,<br>
RegisterMask:Untyped, 0x15c9bbcc8:1<br>
0x15c9bb8b8: i32 = TargetGlobalAddress<void (i8*, i32, i8*, i8*)*<br>
@__assert_func> 0<br>
0x15c9bb9f0: i32 = Register %I18<br>
0x15c9bbac0: i32 = Register %I17<br>
0x15c9bbb90: i32 = Register %I16<br>
0x15c9bbc60: i32 = Register %I15<br>
0x15c9bbd30: Untyped = RegisterMask<br>
0x15c9bbcc8: ch,glue = CopyToReg 0x15c9bbbf8, Register:i32 %I15,<br>
0x15c9bb718, 0x15c9bbbf8:1<br>
0x15c9bbc60: i32 = Register %I15<br>
0x15c9bb718: i32,ch,glue = CopyFromReg 0x15c9bb648:1, Register:i32<br>
%vreg2, 0x15c9bb648:1<br>
0x15c9bb6b0: i32 = Register %vreg2<br>
0x15c9bbbf8: ch,glue = CopyToReg 0x15c9bbb28, Register:i32 %I16,<br>
Constant:i32<0>, 0x15c9bbb28:1<br>
0x15c9bbb90: i32 = Register %I16<br>
0x15c9bb850: i32 = Constant<0><br>
0x15c9bbb28: ch,glue = CopyToReg 0x15c9bba58, Register:i32 %I17,<br>
0x15c9bb648, 0x15c9bba58:1<br>
0x15c9bbac0: i32 = Register %I17<br>
0x15c9bb648: i32,ch,glue = CopyFromReg 0x15c9bb578:1,<br>
Register:i32 %vreg1, 0x15c9bb578:1<br>
0x15c9bb5e0: i32 = Register %vreg1<br>
0x15c9bba58: ch,glue = CopyToReg 0x15c9bb988, Register:i32 %I18,<br>
0x15c9bb578<br>
0x15c9bb9f0: i32 = Register %I18<br>
0x15c9bb578: i32,ch,glue = CopyFromReg 0x15c967b38,<br>
Register:i32 %vreg0<br>
0x15c9bb510: i32 = Register %vreg0<br>
<br>
My TD for this has:<br>
<br>
def SDT_MYCallSeqStart : SDCallSeqStart<[SDTCisVT<0, i32>, SDTCisVT<1,<br>
i32>]>;<br>
def SDT_MYCallSeqEnd : SDCallSeqStart<[SDTCisVT<0, i32>, SDTCisVT<1,<br>
i32>]>;<br>
def MYCallseqStart : SDNode<"ISD::CALLSEQ_START", SDT_MYCallSeqStart,<br>
[SDNPHasChain, SDNPOutGlue]>;<br>
def MYCallseqEnd : SDNode<"ISD::CALLSEQ_END", SDT_MYCallSeqEnd,<br>
[SDNPHasChain, SDNPOptInGlue,<br>
SDNPOutGlue]>;<br>
<br>
def SDT_MYCall : SDTypeProfile<0, 1, [SDTCisVT<0, i32>]>;<br>
def SDT_MYRet : SDTypeProfile<0, 0, []>;<br>
def MYcall : SDNode<"MYISD::CALL", SDT_MYCall,<br>
[SDNPHasChain, SDNPOptInGlue, SDNPOutGlue,<br>
SDNPVariadic]>;<br>
def MYret : SDNode<"MYISD::RET_FLAG", SDTNone,<br>
[SDNPHasChain, SDNPOptInGlue,<br>
SDNPVariadic]>;<br>
<br>
let hasCtrlDep = 1, hasSideEffects = 1 in {<br>
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),<br>
[(MYCallseqStart timm:$amt1,<br>
timm:$amt2)]>;<br>
def ADJCALLSTACKUP : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),<br>
[(MYCallseqEnd timm:$amt1, timm:$amt2)]>;<br>
}<br>
<br>
def: Pat<(MYret), (JMP_Ret (i32 LR))>;<br>
<br>
The function that is failing does warn - "warning: function declared<br>
'noreturn' should not return [-Winvalid-noreturn]", and it does seem to<br>
return. In fact it invokes a custom builtin which does not actually return.<br>
In the past I have just ignored this warning.<br>
<br>
Any hints that might help me to make the necessary adaptations to fix this?<br>
<br>
Thanks in advance,<br>
<br>
MartinO<br>
<br>
PS: I won't be able to reply until Monday as I will be away for the weekend<br>
<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br></div></div>