[PATCH] D118312: [X86] TCRETURNmi fix for 32bit platform
Tong Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 28 12:06:31 PST 2022
ztong0001 updated this revision to Diff 404123.
ztong0001 added a comment.
wrong version is uploaded, pervious version is not counting register correctly
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118312/new/
https://reviews.llvm.org/D118312
Files:
llvm/lib/Target/X86/X86InstrCompiler.td
Index: llvm/lib/Target/X86/X86InstrCompiler.td
===================================================================
--- llvm/lib/Target/X86/X86InstrCompiler.td
+++ llvm/lib/Target/X86/X86InstrCompiler.td
@@ -1235,6 +1235,16 @@
return true;
}]>;
+def X86tcret_1reg : PatFrag<(ops node:$ptr, node:$off),
+ (X86tcret node:$ptr, node:$off), [{
+ // X86tcret args: (*chain, ptr, imm, regs..., glue)
+ unsigned NumRegs = 0;
+ for (unsigned i = 3, e = N->getNumOperands(); i != e; ++i)
+ if (isa<RegisterSDNode>(N->getOperand(i)) && ++NumRegs > 1)
+ return false;
+ return true;
+}]>;
+
def : Pat<(X86tcret ptr_rc_tailcall:$dst, timm:$off),
(TCRETURNri ptr_rc_tailcall:$dst, timm:$off)>,
Requires<[Not64BitMode, NotUseIndirectThunkCalls]>;
@@ -1242,7 +1252,8 @@
// FIXME: This is disabled for 32-bit PIC mode because the global base
// register which is part of the address mode may be assigned a
// callee-saved register.
-def : Pat<(X86tcret (load addr:$dst), timm:$off),
+// Similar to X86tcret_6regs, here we only have 1 register left
+def : Pat<(X86tcret_1reg (load addr:$dst), timm:$off),
(TCRETURNmi addr:$dst, timm:$off)>,
Requires<[Not64BitMode, IsNotPIC, NotUseIndirectThunkCalls]>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118312.404123.patch
Type: text/x-patch
Size: 1279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220128/e1eeacfe/attachment.bin>
More information about the llvm-commits
mailing list