I am using a cross compiler built from llvm trunk source.
Host - x86
Target - AArch64
I am seeing the same loop unroll dump before and after loop unroll
pass using flags - "-O2 -funroll-loops". Is there a way to check
whether the loop has unrolled or not?
As I am seeing both before and after loop unroll dumps as same, is
there a way to dump branch weights? I tried flag "-stats" but I am not
getting any warnings or actual branch weights.
Thanks and Regards,
Shubham
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
On Nov 24, 2021, at 16:46, Shubham Narlawar via llvm-dev <llvm...@lists.llvm.org> wrote:Hello,I am using a cross compiler built from llvm trunk source.Host - x86Target - AArch64I am seeing the same loop unroll dump before and after loop unroll pass using flags - "-O2 -funroll-loops". Is there a way to check whether the loop has unrolled or not?
As I am seeing both before and after loop unroll dumps as same, is there a way to dump branch weights? I tried flag "-stats" but I am not getting any warnings or actual branch weights.
Hi,Please avoid double posting.
On Nov 24, 2021, at 16:46, Shubham Narlawar via llvm-dev <llvm...@lists.llvm.org> wrote:Hello,I am using a cross compiler built from llvm trunk source.Host - x86Target - AArch64I am seeing the same loop unroll dump before and after loop unroll pass using flags - "-O2 -funroll-loops". Is there a way to check whether the loop has unrolled or not?How are you dumping the IR before/after unrolling? You are comparing the IR after all optimizations, note that `-O2 already enables unrolling, so adding `-funroll-loops` shouldn’t change much. You can disable unrolling though, using `-fno-unroll-loops.`
To see which loops have been unrolled, you can use optimization remarks, e.g. add ` -Rpass=loop-unroll `(https://clang.godbolt.org/z/W418qeaGc) or `-fsave-optimization-record`. https://llvm.org/docs/Remarks.htmlAs I am seeing both before and after loop unroll dumps as same, is there a way to dump branch weights? I tried flag "-stats" but I am not getting any warnings or actual branch weights.You can take a look at the metadata in LLVM IR (https://llvm.org/docs/BranchWeightMetadata.html) Not sure if there’s a pass to dump them in a nice way.
Cheers,Florian