[PATCH] D137253: [CVP] Simplify comparisons without constant operand
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 2 09:59:24 PDT 2022
nikic added a subscriber: reames.
nikic added inline comments.
================
Comment at: llvm/test/Transforms/CorrelatedValuePropagation/mul.ll:215-216
entry:
%c = add nuw nsw i8 %b, -3
%mul = mul nsw i8 %c, 4
%cmp = icmp slt i8 %c, %mul
----------------
spatel wrote:
> "add nuw" is all that is needed to fold this and the next test. Do those simpler examples work, or should there be a TODO?
It does work with just `add nuw` (and the `nsw` on `mul` gets inferred). TBH, I don't think this test really makes sense. It was added in https://github.com/llvm/llvm-project/commit/f26758486399a542893addd83cd3a1056911d8bd in preparation for handling nuw/nsw flags on mul, so if the flag ends up not mattering, the test probably doesn't test what it was supposed to.
I think what this might have wanted to test is something closer to this? https://alive2.llvm.org/ce/z/BkZtMv
This patch wouldn't be sufficient to handle that, but this patch + mul nsw support should be able to handle it.
cc @reames
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137253/new/
https://reviews.llvm.org/D137253
More information about the llvm-commits
mailing list