<div dir="ltr">I use clang with -flto option. <div>In this case there is no libLTO is used but lto gold plugin instead: -plugin LLVMgold.so</div><div>I tried to stop in debugger inside a plugin:</div><div><div>447 PM.add(createLoopVectorizePass(true, LoopVectorize));</div><div>(gdb) p LoopVectorize</div><div>$1 = false</div></div><div><br></div><div>I also failed to create breakpoint in lib/LTO/LTOCodeGenerator.cpp where DisableVectorization is set.</div><div>It seems that this file is not a part of gold plugin.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-28 5:44 GMT+03:00 Arnold Schwaighofer <span dir="ltr"><<a href="mailto:aschwaighofer@apple.com" target="_blank">aschwaighofer@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Alexey,<br>
<br>
Are you sure your linker is picking up the right libLTO library? It works for me:<br>
<br>
<br>
<br>
Vectorize per default:<br>
<br>
<br>
<br>
<br>
$ "/usr/bin/ld" -mllvm -debug-only=loop-vectorize -dynamic -arch x86_64 -o a.out test_lto_vectorization.o -lSystem -lto_library /.../debug-cmake/lib/libLTO.dylib <br>
<br>
<br>
<br>
<br>
<br>
<br>
LV: Checking a loop in "foo" from ld-temp.o<br>
<br>
<br>
LV: Interleaving disabled by the pass manager<br>
<br>
<br>
LV: Loop hints: force=? width=0 unroll=1<br>
<br>
<br>
LV: Found a loop: for.body<br>
<br>
<br>
LV: Found an induction variable.<br>
<br>
<br>
LV: Found a write-only loop!<br>
<br>
<br>
LV: We can vectorize this loop!<br>
<br>
<br>
LV: Found trip count: 128<br>
<br>
<br>
LV: The Widest type: 32 bits.<br>
<br>
<br>
LV: The Widest register is: 128 bits.<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 1 For instruction: %indvars.iv = phi i64 [ 0, %<a href="http://for.body.lr.ph" target="_blank">for.body.lr.ph</a> ], [ %indvars.iv.next, %for.body ]<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 1 For instruction: %arrayidx = getelementptr inbounds float* %r, i64 %indvars.iv<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 1 For instruction: %0 = load float* %arrayidx, align 4, !tbaa !1<br>
<br>
<br>
LV: Found an estimated cost of 2 for VF 1 For instruction: %mul = fmul float %0, 2.000000e+00<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 1 For instruction: store float %mul, float* %arrayidx, align 4, !tbaa !1<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 1 For instruction: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 1 For instruction: %exitcond1 = icmp eq i64 %indvars.iv, 127<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 1 For instruction: br i1 %exitcond1, label %for.end, label %for.body<br>
<br>
<br>
LV: Scalar loop costs: 6.<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 2 For instruction: %indvars.iv = phi i64 [ 0, %<a href="http://for.body.lr.ph" target="_blank">for.body.lr.ph</a> ], [ %indvars.iv.next, %for.body ]<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 2 For instruction: %arrayidx = getelementptr inbounds float* %r, i64 %indvars.iv<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 2 For instruction: %0 = load float* %arrayidx, align 4, !tbaa !1<br>
<br>
<br>
LV: Found an estimated cost of 2 for VF 2 For instruction: %mul = fmul float %0, 2.000000e+00<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 2 For instruction: store float %mul, float* %arrayidx, align 4, !tbaa !1<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 2 For instruction: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 2 For instruction: %exitcond1 = icmp eq i64 %indvars.iv, 127<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 2 For instruction: br i1 %exitcond1, label %for.end, label %for.body<br>
<br>
<br>
LV: Vector loop of width 2 costs: 3.<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 4 For instruction: %indvars.iv = phi i64 [ 0, %<a href="http://for.body.lr.ph" target="_blank">for.body.lr.ph</a> ], [ %indvars.iv.next, %for.body ]<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 4 For instruction: %arrayidx = getelementptr inbounds float* %r, i64 %indvars.iv<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 4 For instruction: %0 = load float* %arrayidx, align 4, !tbaa !1<br>
<br>
<br>
LV: Found an estimated cost of 2 for VF 4 For instruction: %mul = fmul float %0, 2.000000e+00<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 4 For instruction: store float %mul, float* %arrayidx, align 4, !tbaa !1<br>
<br>
<br>
LV: Found an estimated cost of 4 for VF 4 For instruction: %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1<br>
<br>
<br>
LV: Found an estimated cost of 1 for VF 4 For instruction: %exitcond1 = icmp eq i64 %indvars.iv, 127<br>
<br>
<br>
LV: Found an estimated cost of 0 for VF 4 For instruction: br i1 %exitcond1, label %for.end, label %for.body<br>
<br>
<br>
LV: Vector loop of width 4 costs: 2.<br>
<br>
<br>
LV: Selecting VF: 4.<br>
<br>
<br>
LV: Found a vectorizable loop (4) in ld-temp.o<br>
<br>
<br>
LV: Unroll Factor is 1<br>
<br>
<br>
<br>
<br>
Disable by passing "disable-lto-vectorization":<br>
<br>
<br>
"/usr/bin/ld" -mllvm -debug-only=loop-vectorize -dynamic -arch x86_64 -o a.out test_lto_vectorization.o -lSystem -lto_library /.../debug-cmake/lib/libLTO.dylib -mllvm -disable-lto-vectorization<br>
<br>
<br>
<br>
<br>
LV: Checking a loop in "foo" from ld-temp.o<br>
<br>
LV: Interleaving disabled by the pass manager<br>
<br>
LV: Loop hints: force=? width=0 unroll=1<br>
<span class=""><br>
LV: Not vectorizing: No #pragma vectorize enable.<br>
<br>
<br>
<br>
<br>
</span>LV: Checking a loop in "main" from ld-temp.o<br>
<br>
LV: Interleaving disabled by the pass manager<br>
<br>
LV: Loop hints: force=? width=0 unroll=1<br>
<span class=""><br>
LV: Not vectorizing: No #pragma vectorize enable.<br>
<br>
<br>
<br>
<br>
<br>
</span><span class="">On 10/27/14, Alexey Volkov wrote:<br>
> Hi Arnold,<br>
><br>
</span>> Unfortunately this change doesn't fix the problem.<br>
<span class="">> I still see messages "LV: Not vectorizing: No #pragma vectorize enable." in debug log.<br>
><br>
><br>
</span>> 2014-10-27 1:07 GMT+03:00 Arnold Schwaighofer <<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a> <<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a>>>:<br>
<span class="">><br>
> ><br>
> ><br>
><br>
> > r220652 restored the old behavior (defaulting to vectorization) while allowing to disable lto vectorization.<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
</span>> > 'disable-lto-vectorization' allows to disable lto vectorization if so desired.<br>
<span class="">> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > Alexey could you let me know whether your testcase works again?<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > Thanks,<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > Arnold<br>
> ><br>
><br>
> ><br>
> ><br>
><br>
> > On 10/24/14, JF Bastien wrote:<br>
> ><br>
><br>
> > > Yes, cl::opt<bool> defaults to false when there's no init. Changing the default will affect non-LTO too. This may be the right thing to do, but isn't my call. Turning it on only for LTO sounds better IMO, but I'm not sure what you're suggesting: I think there shouldn't be a vectorization flags that are different for LTO and for non-LTO.<br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
</span><div><div class="h5">> > > On Fri, Oct 24, 2014 at 8:57 AM, Arnold Schwaighofer <<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a> <<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a>> <<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a> <<a href="mailto:aschwaighofer@apple.com">aschwaighofer@apple.com</a>>>> wrote:<br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > JF are you sure that “LoopVectorize” is set to true by default by the PassManager instance of libLTO?<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > The reason why I forced these parameters to true is that this is not the case if I remember correctly.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > We wanted the default for libLTO to be with vectorization.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PassManager.cpp:<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > static cl::opt<bool><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > RunLoopVectorization("vectorize-loops", cl::Hidden,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > cl::desc("Run the Loop vectorization passes"));<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PassManagerBuilder::PassManagerBuilder() {<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > OptLevel = 2;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > SizeLevel = 0;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > LibraryInfo = nullptr;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > Inliner = nullptr;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > DisableTailCalls = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > DisableUnitAtATime = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > DisableUnrollLoops = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > BBVectorize = RunBBVectorization;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > SLPVectorize = RunSLPVectorization;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > LoopVectorize = RunLoopVectorization;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > RerollLoops = RunLoopRerolling;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > LoadCombine = RunLoadCombine;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > DisableGVNLoadPRE = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > VerifyInput = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > VerifyOutput = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > StripDebug = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > MergeFunctions = false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > }<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > LTOCodeGenerator.cpp:<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > /// Optimize merged modules using various IPO passes<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > bool LTOCodeGenerator::generateObjectFile(raw_ostream &out,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > bool DisableOpt,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > bool DisableInline,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > bool DisableGVNLoadPRE,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > std::string &errMsg) {<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > if (!this->determineTarget(errMsg))<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > return false;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > Module *mergedModule = IRLinker.getModule();<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > // Mark which symbols can not be internalized<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > this->applyScopeRestrictions();<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > // Instantiate the pass manager to organize the passes.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PassManager passes;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > // Add an appropriate DataLayout instance for this module...<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > mergedModule->setDataLayout(TargetMach->getSubtargetImpl()->getDataLayout());<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > Triple TargetTriple(TargetMach->getTargetTriple());<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PassManagerBuilder PMB;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.DisableGVNLoadPRE = DisableGVNLoadPRE;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > if (!DisableInline)<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.Inliner = createFunctionInliningPass();<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.LibraryInfo = new TargetLibraryInfo(TargetTriple);<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > if (DisableOpt)<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.OptLevel = 0;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.VerifyInput = true;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.VerifyOutput = true;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.populateLTOPassManager(passes, TargetMach);<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> ><br>
> ><br>
> > > > I think cl::opt<bool> defaults to false and your commit effectively disabled vectorization during LTO. We can recover this by changing the default cl::opt flags 'vectorize-loops’ and 'vectorize-slp' to true. If that does not work (because we make assumption somewhere about the default being false) we can follow the example of “DisableGVNLoadPRE” in LTOCodeGenerator.cpp and a a flag to disable Vectorization during LTO and pass that to the PassManager created in generateObjectFile.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > PMB.LoopVectorize = !DisableLTOVectorization;<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > Thanks,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > Arnold<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > DisableUnrollLoops<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
</div></div><span class="">> > > > > On Oct 24, 2014, at 5:27 AM, Alexey Volkov <<a href="mailto:avolkov.intel@gmail.com">avolkov.intel@gmail.com</a> <<a href="mailto:avolkov.intel@gmail.com">avolkov.intel@gmail.com</a>> <<a href="mailto:avolkov.intel@gmail.com">avolkov.intel@gmail.com</a> <<a href="mailto:avolkov.intel@gmail.com">avolkov.intel@gmail.com</a>>>> wrote:<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Hi JF,<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > After your commit I saw a performance regression because of disabled Loop Vectorizer:<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > LV: Not vectorizing: No #pragma vectorize enable.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > It is really strange since I used -Ofast -flto clang's options to build an application.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Before this change loop was successfully vectorized by Loop Vectorizer.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Thanks, Alexey.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
</span>> > > > > 2014-10-22 3:18 GMT+04:00 JF Bastien <<a href="mailto:jfb@google.com">jfb@google.com</a> <<a href="mailto:jfb@google.com">jfb@google.com</a>> <<a href="mailto:jfb@google.com">jfb@google.com</a> <<a href="mailto:jfb@google.com">jfb@google.com</a>>>>:<br>
<div><div class="h5">> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Author: jfb<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Date: Tue Oct 21 18:18:21 2014<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > New Revision: 220345<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=220345&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=220345&view=rev</a><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Log:<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > LTO: respect command-line options that disable vectorization.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Summary: Patches 202051 and 208013 added calls to LTO's PassManager which unconditionally add LoopVectorizePass and SLPVectorizerPass instead of following the logic in PassManagerBuilder::populateModulePassManager and honoring the -vectorize-loops -run-slp-after-loop-vectorization flags.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Reviewers: nadav, aschwaighofer, yijiang<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Subscribers: llvm-commits<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Differential Revision: <a href="http://reviews.llvm.org/D5884" target="_blank">http://reviews.llvm.org/D5884</a><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Modified:<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=220345&r1=220344&r2=220345&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=220345&r1=220344&r2=220345&view=diff</a><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > ==============================================================================<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > --- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > +++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Tue Oct 21 18:18:21 2014<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > @@ -440,10 +440,12 @@ void PassManagerBuilder::addLTOOptimizat<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > // More loops are countable; try to optimize them.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > PM.add(createIndVarSimplifyPass());<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > PM.add(createLoopDeletionPass());<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > - PM.add(createLoopVectorizePass(true, true));<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > + PM.add(createLoopVectorizePass(DisableUnrollLoops, LoopVectorize));<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > // More scalar chains could be vectorized due to more alias information<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > - PM.add(createSLPVectorizerPass()); // Vectorize parallel scalar chains.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > + if (RunSLPAfterLoopVectorization)<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > + if (SLPVectorize)<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > + PM.add(createSLPVectorizerPass()); // Vectorize parallel scalar chains.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > // After vectorization, assume intrinsics may tell us more about pointer<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > // alignments.<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > _______________________________________________<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > llvm-commits mailing list<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> ><br>
> ><br>
</div></div>> > > > > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>>><br>
<span class="">> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > --<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Alexey Volkov<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > Intel Corporation<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > _______________________________________________<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > llvm-commits mailing list<br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
</span>> > > > > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a> <<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>>><br>
<div class="HOEnZb"><div class="h5">> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> > ><br>
> ><br>
><br>
> ><br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> Alexey VolkovIntel Corporation<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Volkov<div>Intel Corporation</div></div>
</div>