[PATCH] D97747: [LoopUnrollRuntime] Add option to assume the non latch exit block to be predictable.
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 3 10:41:53 PST 2021
Meinersbur added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:499-501
+ // Allow unrolling of loops with no non latch exit blocks.
+ if (OtherExits.size() == 0)
+ return true;
----------------
This seems to make sense, but isn't this already covered by `!L->getExitingBlock() || OtherExits.size()` in the function that calls `canProfitablyUnrollMultiExitLoop`? (I think we could keep it here, just to make it more explicit)
================
Comment at: llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp:510
return (OtherExits.size() == 1 &&
- OtherExits[0]->getTerminatingDeoptimizeCall());
+ (UnrollRuntimeOtherExitPredictable ||
+ OtherExits[0]->getTerminatingDeoptimizeCall()));
----------------
Looks sensible to me. @bmahjour ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97747/new/
https://reviews.llvm.org/D97747
More information about the llvm-commits
mailing list