[llvm] 6e4f7c0 - [Statepoints] Take result type from gc.result [NFC]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 09:45:24 PST 2022


Author: Philip Reames
Date: 2022-01-31T09:42:34-08:00
New Revision: 6e4f7c08230be1e58dbbe4f6c672b3bf3bc9f357

URL: https://github.com/llvm/llvm-project/commit/6e4f7c08230be1e58dbbe4f6c672b3bf3bc9f357
DIFF: https://github.com/llvm/llvm-project/commit/6e4f7c08230be1e58dbbe4f6c672b3bf3bc9f357.diff

LOG: [Statepoints] Take result type from gc.result [NFC]

When lowering a gc.result, we can assume that the result type of the gc.result matches the type of the underlying call.  This is explicitly required in LangRef.

At the moment, this makes little difference, but for opaque pointers we need a means to get result typing without relying on pointee types.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index 2e8769eb84a5..955efed83172 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -1180,7 +1180,7 @@ void SelectionDAGBuilder::visitGCResult(const GCResultInst &CI) {
   // register because statepoint and actual call return types can be
   // 
diff erent, and getValue() will use CopyFromReg of the wrong type,
   // which is always i32 in our case.
-  Type *RetTy = SI->getActualReturnType();
+  Type *RetTy = CI.getType();
   SDValue CopyFromReg = getCopyFromRegs(SI, RetTy);
   
   assert(CopyFromReg.getNode());


        


More information about the llvm-commits mailing list