[llvm] 3b8ffe6 - [Attributor][FIX] Relax assertion in IRPosition::verify

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 00:26:14 PST 2022


Author: Johannes Doerfert
Date: 2022-02-01T02:25:44-06:00
New Revision: 3b8ffe668db208016665c5af1da1ae4514f9921e

URL: https://github.com/llvm/llvm-project/commit/3b8ffe668db208016665c5af1da1ae4514f9921e
DIFF: https://github.com/llvm/llvm-project/commit/3b8ffe668db208016665c5af1da1ae4514f9921e.diff

LOG: [Attributor][FIX] Relax assertion in IRPosition::verify

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.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Attributor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 1b9e482fa3889..d66140a726f69 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -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()) &&


        


More information about the llvm-commits mailing list