diff options
author | Reid Kleckner <rnk@google.com> | 2017-04-14 20:19:02 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2017-04-14 20:19:02 +0000 |
commit | fb502d2f5e20eb7bd6fb95c407ff4078a530c0fe (patch) | |
tree | ce9278d3d691404cb00cdfa0932ec36c143f6b90 /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | |
parent | 23f28e6c75f80afe8e9f3c3fe739071757df8e09 (diff) | |
download | bcm5719-llvm-fb502d2f5e20eb7bd6fb95c407ff4078a530c0fe.tar.gz bcm5719-llvm-fb502d2f5e20eb7bd6fb95c407ff4078a530c0fe.zip |
[IR] Make paramHasAttr to use arg indices instead of attr indices
This avoids the confusing 'CS.paramHasAttr(ArgNo + 1, Foo)' pattern.
Previously we were testing return value attributes with index 0, so I
introduced hasReturnAttr() for that use case.
llvm-svn: 300367
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index f17e0035a24..bada71debe7 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -3793,7 +3793,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { for (Value *V : CS.args()) { if (V->getType()->isPointerTy() && - !CS.paramHasAttr(ArgNo + 1, Attribute::NonNull) && + !CS.paramHasAttr(ArgNo, Attribute::NonNull) && isKnownNonNullAt(V, CS.getInstruction(), &DT)) Indices.push_back(ArgNo + 1); ArgNo++; |