[PATCH] D46031: [DAGCombiner] Masked merge: if 'B' is constant, de-canonicalize the pattern (invert the mask).

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 2 11:11:01 PDT 2018


spatel added inline comments.


================
Comment at: test/CodeGen/AArch64/unfold-masked-merge-scalar-variablemask.ll:350-355
-; CHECK-NEXT:    and w8, w0, w2
-; CHECK-NEXT:    orn w0, w8, w2
+; CHECK-NEXT:    mvn w8, w0
+; CHECK-NEXT:    bic w8, w8, w2
+; CHECK-NEXT:    orr w0, w8, w0
 ; CHECK-NEXT:    ret
   %n0 = xor i32 %x, -1 ; %x
   %n1 = and i32 %n0, %mask
   %r = xor i32 %n1, -1
----------------
How does this happen? Isn't that a miscompile?


Repository:
  rL LLVM

https://reviews.llvm.org/D46031





More information about the llvm-commits mailing list