[PATCH] D25963: [LoopUnroll] Implement profile-based loop peeling

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 20:28:05 PST 2016


danielcdh added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1089
+  if (!LatchBR->extractProfMetadata(TrueVal, FalseVal))
+    return None;
+
----------------
mkuper wrote:
> Actually, now that I think about this again, I'm not sure this is right.
> Dehao, for instrumentation-based profiles, do back-edges of loops that are never taken get any profile metadata? I think they don't, in which case this should probably return 0.
I'm not sure about instrumentation-based profiles, but for sample-based profiles, if the backedge is never taken (but executed and thus has sample), it will still get branch probability metadata annotated, which will be (sample_count+1, 1)


https://reviews.llvm.org/D25963





More information about the llvm-commits mailing list