[X86] Correct SHRUNKBLEND creation to work correctly when there are multiple uses...
authorCraig Topper <craig.topper@intel.com>
Tue, 20 Feb 2018 17:58:17 +0000 (17:58 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 20 Feb 2018 17:58:17 +0000 (17:58 +0000)
commitdf0c22fcd3b0dd4b66e2f34346b6012a457a09c8
tree2e977a4e99920a0cc23d0f53862665b4efce7e91
parent4f61714fd6263311126954aeb374fd62071d8e20
[X86] Correct SHRUNKBLEND creation to work correctly when there are multiple uses of the condition.

SimplifyDemandedBits forces the demanded mask to all 1s if the node has multiple uses, unless the AssumeSingleUse flag is set.

So previously we were only really likely to simplify something if the condition had a single use. And on the off chance we did simplify with multiple uses the demanded mask being used was all ones so there was no reason to create a shrunkblend.

This patch now checks that the condition is only used by selects first, and then sets the AssumeSingleUse flag for the simplifcation. Then we convert the selects to shrunkblend, and finally replace condition.

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

llvm-svn: 325604
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vselect.ll