llvm.org GIT mirror llvm / 24f48ec
[indvars] Fix PR10946: SCEV cannot handle Vector IVs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140026 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
2 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8383
8484 /// foldIVUser - Fold an IV operand into its use. This removes increments of an
8585 /// aligned IV when used by a instruction that ignores the low bits.
86 ///
87 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
8688 ///
8789 /// Return the operand of IVOperand for this induction variable if IVOperand can
8890 /// be folded (in case more folding opportunities have been exposed).
240242
241243 /// eliminateIVUser - Eliminate an operation that consumes a simple IV and has
242244 /// no observable side-effect given the range of IV values.
245 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
243246 bool SimplifyIndvar::eliminateIVUser(Instruction *UseInst,
244247 Instruction *IVOperand) {
245248 if (ICmpInst *ICmp = dyn_cast(UseInst)) {
323326 /// Once DisableIVRewrite is default, LSR will be the only client of IVUsers.
324327 ///
325328 void SimplifyIndvar::simplifyUsers(PHINode *CurrIV, IVVisitor *V) {
329 if (!SE->isSCEVable(CurrIV->getType()))
330 return;
331
326332 // Instructions processed by SimplifyIndvar for CurrIV.
327333 SmallPtrSet Simplified;
328334
0 ; RUN: opt < %s -indvars -S | FileCheck %s
1 ; PR10946: Vector IVs are not SCEVable.
2 ; CHECK-NOT: phi
3 define void @test() nounwind {
4 allocas:
5 br i1 undef, label %cif_done, label %for_loop398
6
7 cif_done: ; preds = %allocas
8 ret void
9
10 for_loop398: ; preds = %for_loop398, %allocas
11 %storemerge35 = phi <4 x i32> [ %storemerge, %for_loop398 ], [ undef, %allocas ]
12 %bincmp431 = icmp sge <4 x i32> %storemerge35,
13 %storemerge = bitcast <4 x float> undef to <4 x i32>
14 br label %for_loop398
15 }