[Attributor][FIX] Relax assertion in IRPosition::verify
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 1 Feb 2022 08:23:55 +0000 (02:23 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 1 Feb 2022 08:25:44 +0000 (02:25 -0600)
A call base can be a floating value if we talk about the instruction and
not the return value. This distinction was not made before but is
important for liveness, e.g., a call site return value might be unused
(=dead) but the call site is not.

llvm/lib/Transforms/IPO/Attributor.cpp

index 1b9e482..d66140a 100644 (file)
@@ -885,9 +885,8 @@ void IRPosition::verify() {
            "Expected a nullptr for an invalid position!");
     return;
   case IRP_FLOAT:
-    assert((!isa<CallBase>(&getAssociatedValue()) &&
-            !isa<Argument>(&getAssociatedValue())) &&
-           "Expected specialized kind for call base and argument values!");
+    assert((!isa<Argument>(&getAssociatedValue())) &&
+           "Expected specialized kind for argument values!");
     return;
   case IRP_RETURNED:
     assert(isa<Function>(getAsValuePtr()) &&