[PATCH] D141359: [AArch64] Only enable `foldCSELOfCSEl` DAG combine when x != y

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 14:09:22 PST 2023


dmgreen accepted this revision.
dmgreen added a comment.
This revision is now accepted and ready to land.

LGTM Thanks



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:20024
 
+// When x != y
 // (CSEL l r EQ (CMP (CSEL x y cc2 cond) x)) => (CSEL l r cc2 cond)
----------------
These could be combined into the "Where x and y are constants" line.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:20057-20060
+  // If one of the constant is opaque constant,
+  // x,y sdnode is still different but the real value
+  // maybe the same. So check APInt here to make sure
+  // the code is correct.
----------------
This comment could be formatted to flow better.


================
Comment at: llvm/test/CodeGen/AArch64/pr59902.ll:4
+
+; this used to miscompile because foldCSELOfCSEL function
+; doesn't check const x != y
----------------
this -> This


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

https://reviews.llvm.org/D141359



More information about the llvm-commits mailing list