summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2019-11-01 23:32:17 -0500
committerJohannes Doerfert <johannes@jdoerfert.de>2019-11-02 01:22:41 -0500
commit4c56086f8b458bbe8300b0cbd59baaf46ea38d7c (patch)
tree576ad6d20e7d79ade7106393885ac8af2102e40f
parent83503ad1196549ee6cc6d43e7f8db7eaaa6afbc6 (diff)
downloadbcm5719-llvm-4c56086f8b458bbe8300b0cbd59baaf46ea38d7c.tar.gz
bcm5719-llvm-4c56086f8b458bbe8300b0cbd59baaf46ea38d7c.zip
[AbstractCallSite][FIX] Correct faulty assertion
When the Attributor run on the IPConstantProp test case for multiple callbacks it triggered a faulty assertion in the AbstractCallSite implementation. The callee can well be at argument position 0.
-rw-r--r--llvm/include/llvm/IR/CallSite.h2
-rw-r--r--llvm/test/Transforms/IPConstantProp/multiple_callbacks.ll1
2 files changed, 2 insertions, 1 deletions
diff --git a/llvm/include/llvm/IR/CallSite.h b/llvm/include/llvm/IR/CallSite.h
index 13b1ae8d0e3..60f656e7a27 100644
--- a/llvm/include/llvm/IR/CallSite.h
+++ b/llvm/include/llvm/IR/CallSite.h
@@ -850,7 +850,7 @@ public:
/// callee of this ACS. Only valid for callback calls!
int getCallArgOperandNoForCallee() const {
assert(isCallbackCall());
- assert(CI.ParameterEncoding.size() && CI.ParameterEncoding[0] > 0);
+ assert(CI.ParameterEncoding.size() && CI.ParameterEncoding[0] >= 0);
return CI.ParameterEncoding[0];
}
diff --git a/llvm/test/Transforms/IPConstantProp/multiple_callbacks.ll b/llvm/test/Transforms/IPConstantProp/multiple_callbacks.ll
index 3288b5b94de..0d1df8dff52 100644
--- a/llvm/test/Transforms/IPConstantProp/multiple_callbacks.ll
+++ b/llvm/test/Transforms/IPConstantProp/multiple_callbacks.ll
@@ -1,4 +1,5 @@
; RUN: opt -ipconstprop -S < %s | FileCheck %s
+; RUN: opt -S -passes=attributor -aa-pipeline='basic-aa' -attributor-disable=false -attributor-max-iterations-verify -attributor-max-iterations=1 < %s | FileCheck %s
;
;
; /---------------------------------------|
OpenPOWER on IntegriCloud