Simplify and avoid undefined shift. Based on patch by Ahmed Charles.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 13 Oct 2011 22:40:23 +0000 (22:40 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 13 Oct 2011 22:40:23 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141903 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMISelLowering.cpp

index 0313f99908c24236f0c4bcf0b05c0b8a7a5b6a02..2ac52cfc366c2d3557a9c4473204308247182dda 100644 (file)
@@ -3944,8 +3944,7 @@ SDValue ARMTargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
       }
 
       // Try an immediate VMVN.
-      uint64_t NegatedImm = (SplatBits.getZExtValue() ^
-                             ((1LL << SplatBitSize) - 1));
+      uint64_t NegatedImm = (~SplatBits).getZExtValue();
       Val = isNEONModifiedImm(NegatedImm,
                                       SplatUndef.getZExtValue(), SplatBitSize,
                                       DAG, VmovVT, VT.is128BitVector(),