[PATCH] D138542: [InstSimplify] Use dominate condtion to simplify xor/sub

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 05:11:35 PST 2022


spatel added a comment.

There's a question of where this kind of transform belongs - CVP, SCCP?

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?



================
Comment at: llvm/test/Transforms/InstSimplify/domcondition.ll:36
+; CHECK:       cond.end:
+; CHECK-NEXT:    ret i32 0
+;
----------------
Something went wrong - this should not simplify?


================
Comment at: llvm/test/Transforms/InstSimplify/domcondition.ll:68
+cond.true:
+  %xor = xor i32 %x, %y
+  %mul = mul i32 %xor, %x
----------------
xor -> sub?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138542/new/

https://reviews.llvm.org/D138542



More information about the llvm-commits mailing list