[TargetLowering] Fix undef vector element issue with true/false result handling
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 8 Nov 2016 15:07:01 +0000 (15:07 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 8 Nov 2016 15:07:01 +0000 (15:07 +0000)
commit778596bf5961bcc74f713b48610999d28db47791
treeea1a38d55b10e054069b339d194f8103ea4fdb0d
parentc0e47fbfb26bcdc256b21e50ba8e705a6107e222
[TargetLowering] Fix undef vector element issue with true/false result handling

Fixed an issue with vector usage of TargetLowering::isConstTrueVal / TargetLowering::isConstFalseVal boolean result matching.

The comment said we shouldn't handle constant splat vectors with undef elements. But the the actual code was returning false if the build vector contained no undef elements....

This patch now ignores the number of undefs (getConstantSplatNode will return null if the build vector is all undefs).

The change has also unearthed a couple of missed opportunities in AVX512 comparison code that will need to be addressed.

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

llvm-svn: 286238
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/X86/avx512-ext.ll
llvm/test/CodeGen/X86/avx512-vec-cmp.ll
llvm/test/CodeGen/X86/v8i1-masks.ll