Splitting a loop to make range checks redundant is profitable only if the range check "never" fails. Make this fact a part of recognizing a range check -- a branch is a range check only if it is expected to pass (via branch_weights metadata).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | ||
---|---|---|
358 ↗ | (On Diff #18796) | Please don't access the branch_weights metadata directly. Use the BranchProbabilityInfo analysis (which also includes some useful static heuristics). |
Comment Actions
Address Hal's comment and use BranchProbabilityInfo instead of manually parsing branch_weights metadata.