]> granicus.if.org Git - llvm/commit
[TargetLowering] fix isConstTrueVal to account for build vector truncation
authorSanjay Patel <spatel@rotateright.com>
Wed, 26 Apr 2017 14:05:42 +0000 (14:05 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 26 Apr 2017 14:05:42 +0000 (14:05 +0000)
commit553bcb5841bbf0e267f78f8f6d6dc57f8f0aab91
treeac421f0d3ee7809b990d768c51f2ec1865ba92f2
parent4c814e62fc051783c0aa0fdba1fe4dab04e7ac65
[TargetLowering] fix isConstTrueVal to account for build vector truncation

Build vectors have magical truncation powers, so we have things like this:

v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>

If we don't truncate the splat node returned by getConstantSplatNode(), then we won't find
truth when ZeroOrNegativeOneBooleanContent is the rule.

Differential Revision: https://reviews.llvm.org/D32505

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301408 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/setcc-combine.ll