[PATCH] D91924: [X86] Have indirect calls take pointer-sized operands
Harald van Dijk via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 21 14:02:30 PST 2020
hvdijk updated this revision to Diff 306876.
hvdijk added a comment.
Forgot to run clang-format-diff before uploading, updated now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91924/new/
https://reviews.llvm.org/D91924
Files:
llvm/lib/Target/X86/X86FastISel.cpp
llvm/test/CodeGen/X86/pic.ll
Index: llvm/test/CodeGen/X86/pic.ll
===================================================================
--- llvm/test/CodeGen/X86/pic.ll
+++ llvm/test/CodeGen/X86/pic.ll
@@ -100,7 +100,7 @@
; CHECK-I686: calll *
; CHECK-X32: callq afoo at PLT
; CHECK-X32: movl pfoo at GOTPCREL(%rip),
-; CHECK-X32: callq *
+; CHECK-X32: call{{l|q}} *
}
declare void(...)* @afoo(...)
Index: llvm/lib/Target/X86/X86FastISel.cpp
===================================================================
--- llvm/lib/Target/X86/X86FastISel.cpp
+++ llvm/lib/Target/X86/X86FastISel.cpp
@@ -3483,9 +3483,10 @@
MachineInstrBuilder MIB;
if (CalleeOp) {
// Register-indirect call.
- unsigned CallOpc = Is64Bit ? X86::CALL64r : X86::CALL32r;
+ unsigned CallOpc =
+ TLI.getPointerTy(DL) == MVT::i64 ? X86::CALL64r : X86::CALL32r;
MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(CallOpc))
- .addReg(CalleeOp);
+ .addReg(CalleeOp);
} else {
// Direct call.
assert(GV && "Not a direct call");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91924.306876.patch
Type: text/x-patch
Size: 1033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201121/187229a9/attachment.bin>
More information about the llvm-commits
mailing list