OSDN Git Service

[IndVars] Pass the right loop to isLoopInvariantPredicate
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 18 Mar 2016 20:37:07 +0000 (20:37 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 18 Mar 2016 20:37:07 +0000 (20:37 +0000)
commitb289a8343894a667334d94c32074a273421ac771
tree5dabef1f50858deb9dc4f5da84c82ab32881cb1c
parent643e47a345d442100211fb4e2a31e878a49b60a6
[IndVars] Pass the right loop to isLoopInvariantPredicate

The loop on IVOperand's incoming values assumes IVOperand to be an
induction variable on the loop over which `S Pred X` is invariant;
otherwise loop invariant incoming values to IVOperand are not guaranteed
to dominate the comparision.

This fixes PR26973.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263827 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyIndVar.cpp
test/Transforms/IndVarSimplify/pr26973.ll [new file with mode: 0644]