diff options
| author | Craig Topper <craig.topper@intel.com> | 2019-09-27 18:23:55 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2019-09-27 18:23:55 +0000 |
| commit | 750bdda6388668b4fea655ced20bd4e59fe6c968 (patch) | |
| tree | c759c891818ccef9932a77bda9a55517e512ed7f /llvm/lib | |
| parent | 432a88bf04532f2bf800963f074d82787ad1dec2 (diff) | |
| download | bcm5719-llvm-750bdda6388668b4fea655ced20bd4e59fe6c968.tar.gz bcm5719-llvm-750bdda6388668b4fea655ced20bd4e59fe6c968.zip | |
[X86] Call SimplifyDemandedBits in combineGatherScatter any time the mask element is wider than i1, not just when AVX512 is disabled.
The AVX2 intrinsics can still be used when AVX512 is enabled and
those go through this path. So we should simplify them.
llvm-svn: 373108
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index ff927a4df92..77a7489a2b5 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -43425,10 +43425,10 @@ static SDValue combineGatherScatter(SDNode *N, SelectionDAG &DAG, } } - // With AVX2 we only demand the upper bit of the mask. - if (!Subtarget.hasAVX512()) { + // With vector masks we only demand the upper bit of the mask. + SDValue Mask = N->getOperand(2); + if (Mask.getScalarValueSizeInBits() != 1) { const TargetLowering &TLI = DAG.getTargetLoweringInfo(); - SDValue Mask = N->getOperand(2); APInt DemandedMask(APInt::getSignMask(Mask.getScalarValueSizeInBits())); if (TLI.SimplifyDemandedBits(Mask, DemandedMask, DCI)) return SDValue(N, 0); |

