[PATCH] D122754: [DAG] Allow XOR(X,MIN_SIGNED_VALUE) to perform AddLike folds

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 04:49:28 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/test/CodeGen/X86/movmsk-cmp.ll:4548
+; SSE-NEXT:    xorb $1, %al
+; SSE-NEXT:    cmpb $2, %al
 ; SSE-NEXT:    movl $42, %ecx
----------------
Looks like we're missing this fold, but I haven't had time to investigate yet:
```
----------------------------------------
define i1 @src(i8 %a) {
%0:
  %x = xor i8 %a, 1
  %r = icmp eq i8 %x, 2
  ret i1 %r
}
=>
define i1 @tgt(i8 %a) {
%0:
  %r = icmp eq i8 %a, 3
  ret i1 %r
}
Transformation seems to be correct!
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122754



More information about the llvm-commits mailing list