hameeza ahmed via llvm-dev
2019-Oct-14 09:21 UTC
[llvm-dev] No vectorization with -loop-vectorize and -slp-vectorizer
Hello, I am trying to test individual optimizations of opt on unoptimized IR. But, the IR is not getting vectorized by using following commands. Documents/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang -O1 -Xclang -disable-llvm-passes -emit-llvm -S vecsum.c -o vecsum-noopt.ll Documents/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/opt -loop-vectorize -slp-vectorizer -S vecsum-noopt.ll -o vecto.ll Though IR gets vectorized with O3 flag. Even I tried to replicate O3 behavior via individual flags with opt. But It is not showing same IR. Where am I doing mistake? Please help Thank You Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191014/beec8bea/attachment.html>
Michael Kruse via llvm-dev
2019-Oct-14 23:58 UTC
[llvm-dev] No vectorization with -loop-vectorize and -slp-vectorizer
Likely because the loop-vectorizer requires a canonicalized input form, specifically LoopRotate. `-O1 -Xclang -disable-llvm-passes` will disable all passes, including LoopRotate. `-O1 -Xclang -disable-O0-optnone` does run those passes and since you are using `-O1`, the switch `-Xclang -disable-O0-optnone` has no effect. Michael Am Mo., 14. Okt. 2019 um 04:22 Uhr schrieb hameeza ahmed via llvm-dev <llvm-dev at lists.llvm.org>:> > Hello, > I am trying to test individual optimizations of opt on unoptimized IR. But, the IR is not getting vectorized by using following commands. > > Documents/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang -O1 -Xclang -disable-llvm-passes -emit-llvm -S vecsum.c -o vecsum-noopt.ll > > Documents/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/opt -loop-vectorize -slp-vectorizer -S vecsum-noopt.ll -o vecto.ll > > Though IR gets vectorized with O3 flag. Even I tried to replicate O3 behavior via individual flags with opt. But It is not showing same IR. > > Where am I doing mistake? > > Please help > > Thank You > Regards > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev