[PATCH] D128904: Bug fix "GC relocate is incorrectly tied to the statepoint"

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 05:10:44 PDT 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp:173
+    const Value *Statepoint = Relocate->getStatepoint();
+    if (isa<UndefValue>(Statepoint))
+      return None;
----------------
apilipenko wrote:
> Assert `isa<GCStatepointInst, UndefValue>(Statepoint)`
> 
Not sure if this assert is needed at all, because it will naturally be asserted by `cast` below.


================
Comment at: llvm/lib/IR/IntrinsicInst.cpp:719
 Value *GCRelocateInst::getBasePtr() const {
-  if (auto Opt = getStatepoint()->getOperandBundle(LLVMContext::OB_gc_live))
+  auto Statepoint = getStatepoint();
+  if (isa<UndefValue>(Statepoint))
----------------
auto*


================
Comment at: llvm/lib/IR/IntrinsicInst.cpp:721
+  if (isa<UndefValue>(Statepoint))
+    return const_cast<Value *>(Statepoint);
+
----------------
Remove const_cast


================
Comment at: llvm/test/Transforms/InstCombine/gc.relocate-verify.ll:11
+
+unreach:
+    ; CHECK: token undef
----------------
unreached


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128904/new/

https://reviews.llvm.org/D128904



More information about the llvm-commits mailing list