Skip to content

Commit 7bd2b3d

Browse files
committed
[X86] shouldFoldMaskToVariableShiftPair should be true for scalars up to the biggest legal type
For X86, we want to do this for scalars up to the biggest legal type.
1 parent 23c1ed5 commit 7bd2b3d

File tree

2 files changed

+72
-313
lines changed

2 files changed

+72
-313
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,11 +3659,8 @@ bool X86TargetLowering::shouldFoldMaskToVariableShiftPair(SDValue Y) const {
36593659
if (VT.isVector())
36603660
return false;
36613661

3662-
// 64-bit shifts on 32-bit targets produce really bad bloated code.
3663-
if (VT == MVT::i64 && !Subtarget.is64Bit())
3664-
return false;
3665-
3666-
return true;
3662+
unsigned MaxWidth = Subtarget.is64Bit() ? 64 : 32;
3663+
return VT.getScalarSizeInBits() <= MaxWidth;
36673664
}
36683665

36693666
TargetLowering::ShiftLegalizationStrategy

0 commit comments

Comments
 (0)