[PATCH] D138542: [InstSimplify] Use dominate condtion to simplify xor/sub
chenglin.bi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 23 05:36:26 PST 2022
bcl5980 added a comment.
In D138542#3946536 <https://reviews.llvm.org/D138542#3946536>, @spatel wrote:
> There's a question of where this kind of transform belongs - CVP, SCCP?
I guess if one of the compare value is constant, it should be IPSCCP. If both of them are not constant, it should be CVP.
> This seems fine to me, but it should probably be split off into a helper function. We could do the same for srem/urem? sdiv/udiv with a slight adjustment? any other opcodes?
Yeah, you are right. div/rem should work also.
================
Comment at: llvm/test/Transforms/InstSimplify/domcondition.ll:36
+; CHECK: cond.end:
+; CHECK-NEXT: ret i32 0
+;
----------------
spatel wrote:
> Something went wrong - this should not simplify?
Yeah, this is a negative test. The condition is icmp ne.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138542/new/
https://reviews.llvm.org/D138542
More information about the llvm-commits
mailing list