[PATCH] D119712: [Safepoint Verifier] gc.relocate does not change the constant property.

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 21:19:26 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG57092d4f4f3c: [Safepoint Verifier] gc.relocate does not change the constant property. (authored by skatkov).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119712

Files:
  llvm/lib/IR/SafepointIRVerifier.cpp
  llvm/test/SafepointIRVerifier/hidden-constant-base.ll


Index: llvm/test/SafepointIRVerifier/hidden-constant-base.ll
===================================================================
--- llvm/test/SafepointIRVerifier/hidden-constant-base.ll
+++ llvm/test/SafepointIRVerifier/hidden-constant-base.ll
@@ -1,12 +1,7 @@
 ; RUN: opt -safepoint-ir-verifier-print-only -verify-safepoint-ir -S %s 2>&1 | FileCheck %s
 
-; This is a false positive case. Actually base of %tmp5 is null but verifier does not see that.
-; As a result it states that %tmp5 can have a unrelocated value of %tmp.
-; Relocation of %tmp is expected to be after the call to @widget but it is not required
-; due to %tmp is always null as well.
-
 ; CHECK-LABEL: Verifying gc pointers in function: test
-; CHECK: Illegal use of unrelocated value found!
+; CHECK: No illegal uses found by SafepointIRVerifier in: test
 define i8 addrspace(1)* @test(i1 %arg) gc "statepoint-example" {
 bb:
   br label %bb2
Index: llvm/lib/IR/SafepointIRVerifier.cpp
===================================================================
--- llvm/lib/IR/SafepointIRVerifier.cpp
+++ llvm/lib/IR/SafepointIRVerifier.cpp
@@ -357,6 +357,10 @@
       Worklist.push_back(SI->getFalseValue());
       continue;
     }
+    if (const auto *GCRelocate = dyn_cast<GCRelocateInst>(V)) {
+      Worklist.push_back(GCRelocate->getDerivedPtr());
+      continue;
+    }
     if (isa<Constant>(V)) {
       // We found at least one base pointer which is non-null, so this derived
       // pointer is not exclusively derived from null.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119712.408703.patch
Type: text/x-patch
Size: 1510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220215/3f9b5319/attachment.bin>


More information about the llvm-commits mailing list