[PATCH] D137632: [LoopPredication] Widen checks if condition operands constant ranges are known
Yevgeny Rouban via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 21:58:02 PST 2022
yrouban added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopPredication.cpp:840
+
+ if (RHSRange.isFullSet()) {
+ LLVM_DEBUG(dbgs() << "RHS range is full-set\n");
----------------
do it right after RHSRange = ComputeRange() and only then calculate LHSRange.
================
Comment at: llvm/lib/Transforms/Scalar/LoopPredication.cpp:852
+ if (IsSigned)
+ LHSMaxIsGreaterThanRHSMax = LHSMaxValue.sgt(RHSMaxValue);
+ if (LHSMaxIsGreaterThanRHSMax) {
----------------
mkazantsev wrote:
> ```
> if (IsSigned)
> LHSMaxIsGreaterThanRHSMax = LHSMaxValue.sgt(RHSMaxValue);
> else
> HSMaxIsGreaterThanRHSMax = LHSMaxValue.ugt(RHSMaxValue);
> ```
> ?
or
```
bool LHSMaxIsGreaterThanRHSMax = IsSigned
? LHSMaxValue.sgt(RHSMaxValue)
: LHSMaxValue.ugt(RHSMaxValue);
```
or even a bigger change without introduced LHSMaxValue and RHSMaxValue:
```
bool IsGreaterThanRHSMax = IsSigned
? LHSRange.getSignedMax().sgt(RHSRange.getSignedMax())
: LHSRange.getUnsignedMax().ugt(RHSRange.getUnsignedMax());
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137632/new/
https://reviews.llvm.org/D137632
More information about the llvm-commits
mailing list