[PATCH] D144777: [InstCombine] Fold signbit test of a pow2 or zero

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 26 06:38:13 PST 2023


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/fold-signbit-test-power2.ll:14
+
+define i1 @pow2_or_zero2(i8 %x) {
+; CHECK-LABEL: @pow2_or_zero2(
----------------
Ths isn't testing what you expected because the `and` operands will be commuted before they reach the transform in this patch. This would be easier to see if you pre-commit the tests with baseline results (no pre-commit Phab review is needed for that NFC change).

grep for "thwart complexity-based canonicalization" in the test directory to see how to create a test that handles the commuted pattern.


================
Comment at: llvm/test/Transforms/InstCombine/fold-signbit-test-power2.ll:36
+
+define i1 @pow2_or_zero4(i8 %x) {
+; CHECK-LABEL: @pow2_or_zero4(
----------------
See comment about commuting - same as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144777



More information about the llvm-commits mailing list