[PATCH] D48853: [SCEV] Add [zs]ext{C, +, x} -> (D + [zs]ext{C-D, +, x})<nuw><nsw> transform
Roman Tereshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 19 18:29:19 PDT 2018
rtereshin added inline comments.
================
Comment at: lib/Analysis/ScalarEvolution.cpp:1570-1579
+ // ConstantRange is unable to prove that it's possible to transform
+ // an expression like (5 + (4 * X)) to (1 + (4 + (4 * X))) w/o underflowing:
+ //
+ // | Expression | ConstantRange | KnownBits |
+ // |---------------|------------------------|-----------------------|
+ // | i8 4 * X | [L: 0, U: 253) | XXXX XX00 |
+ // | | => Min: 0, Max: 252 | => Min: 0, Max: 252 |
----------------
mzolotukhin wrote:
> Maybe move that comment to the explanation in the commit message too? It's not obvious what `ConstantRange` has to with the code around (I understand where it comes from, but I have the full context of the patch now - for someone browsing through the code later it won't be clear why we mention `ConstantRange` here).
Yeah, it felt like out of place for a while now, that's a good suggestion, will do.
Thanks for accepting the patch!
Repository:
rL LLVM
https://reviews.llvm.org/D48853
More information about the llvm-commits
mailing list