[PATCH] D31944: [DAGCombiner] add (sext i1 X), 1 --> zext (not i1 X)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 10:52:47 PDT 2017


spatel added a comment.

The getNOT call on ARM returns:
v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
(the 'v4i1' is backed by 32-bit constants, and they are 1, not -1)...which then does not match the definition for TLI.isConstTrueVal(). Something similar happens with x86 too, but we catch the not(setcc) pattern post-legalization. That fails on ARM because there are size changing ops obfuscating the pattern:

        t50: v4i32 = setcc t16, t19, seteq:ch
      t51: v4i16 = truncate t50
      t49: v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
    t52: v4i16 = xor t51, t49
  t53: v4i32 = any_extend t52


https://reviews.llvm.org/D31944





More information about the llvm-commits mailing list