We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf34b2e commit c044f13Copy full SHA for c044f13
llvm/include/llvm/CodeGen/TargetLowering.h
@@ -839,8 +839,11 @@ class LLVM_ABI TargetLoweringBase {
839
/// Return true if the variant with 2 variable shifts is preferred.
840
/// Return false if there is no preference.
841
virtual bool shouldFoldMaskToVariableShiftPair(SDValue X) const {
842
- // By default, let's assume that no one prefers shifts.
843
- return false;
+ // By default, let's assume that no one prefers shifts for vectors
+ EVT VT = X.getValueType();
844
+
845
+ // Prefer shifts for legal types
846
+ return isOperationLegal(ISD::SHL, VT);
847
}
848
849
/// Return true if it is profitable to fold a pair of shifts into a mask.
0 commit comments