[PATCH] D28593: Update loop branch_weight metadata after loop rotation.
Michael Kuperstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 12:59:32 PST 2017
mkuper added inline comments.
================
Comment at: lib/Transforms/Scalar/LoopRotation.cpp:476
+ // data.
+ if (!updateLoopEstimatedBranchWeight(L, GBI, BI /* OrigHeader BR */)) {
+ BI->setMetadata(LLVMContext::MD_prof, nullptr);
----------------
Also, regardless of the rest of the discussion - I don't think we should drop the metadata on the floor if we fail.
I don't think "No data is better than imprecise data" is right in the general case, but that's arguable. Specifically here, though, we're imprecise even if updateLoopEstimatedBranchWeight() succeeds, because of the assumptions we make on the distribution.
https://reviews.llvm.org/D28593
More information about the llvm-commits
mailing list