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

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 21:19:26 PST 2016


mkuper added inline comments.


================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1089
+  if (!LatchBR->extractProfMetadata(TrueVal, FalseVal))
+    return None;
+
----------------
danielcdh wrote:
> 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)
Ok, will keep it as is, then.


https://reviews.llvm.org/D25963





More information about the llvm-commits mailing list