[llvm-bugs] [Bug 32698] New: LoopVectorizer is analyzing poorly due to unoptimized input
llvm-bugs at lists.llvm.org
Tue Apr 18 04:55:16 PDT 2017
Bug ID: 32698
Summary: LoopVectorizer is analyzing poorly due to unoptimized
Component: Loop Optimizer
Assignee: unassignedbugs at nondot.org
Reporter: paulsson at linux.vnet.ibm.com
CC: llvm-bugs at lists.llvm.org
Created attachment 18305
automatically reduced test case with loop.
I came across a loop that for the loop vectorizer looks like:
%indvars.iv1225 = phi i64
%typed_outval.1909 = phi i32
%arrayidx36 = getelementptr
%58 = load i8, i8* %arrayidx36, align 1, !tbaa !11
%conv37 = zext i8 %58 to i32
%conv38 = and i32 %typed_outval.1909, 255
%add39 = add nuw nsw i32 %conv38, %conv37
%indvars.iv.next1226 = add nsw i64 %indvars.iv1225, 1
%cmp31 = icmp slt i64 %indvars.iv.next1226, %57
br i1 %cmp31, label %for.body33, label %for.end43.loopexit
It then thinks about these instructions with TTI individually. The problem is
that this is a phi that later gets optimized by InstCombine, because it is
actually just an i8 value, due to the 'and 255'.
A first thought is to run the instcombiner or some similar phi optimizer before
LoopVectorizer. Another idea is that it seems that SROA is introducing this
phi, which it could optimize?
Why is this not done? Compile time?
bin/opt -mtriple=s390x-unknown-linux -mcpu=z13 -O3 ./LoopVec_phi.ll -o
./out.opt.ll -S -debug-only=loop-vectorize
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs