[llvm] [FastIsel] Get the right register type for call instruction (PR #164565)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 00:17:18 PDT 2025


================
@@ -1977,8 +1977,13 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
   if (const Instruction *Inst = dyn_cast<Instruction>(V)) {
     Register InReg = FuncInfo.InitializeRegForValue(Inst);
 
+    std::optional<CallingConv::ID> CallConv = std::nullopt;
+    auto *Callee = dyn_cast<CallInst>(Inst);
+    if (Callee && !Callee->isInlineAsm())
+      CallConv = Callee->getCallingConv();
----------------
arsenm wrote:

This is broken for indirect calls. You should take the calling convention directly from the callsite, not the callee 

https://github.com/llvm/llvm-project/pull/164565


More information about the llvm-commits mailing list