Skip to content

Commit f8ff3bf

Browse files
author
Sam Parker
committed
Revert "[ARM][MVE] Sink vector shift operand"
This reverts commit e0b9666. Instruction selection is failing with expensive checks.
1 parent 02bb202 commit f8ff3bf

File tree

4 files changed

+21
-462
lines changed

4 files changed

+21
-462
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11814,8 +11814,7 @@ static SDValue PerformADDCombine(SDNode *N,
1181411814
/// PerformSUBCombine - Target-specific dag combine xforms for ISD::SUB.
1181511815
///
1181611816
static SDValue PerformSUBCombine(SDNode *N,
11817-
TargetLowering::DAGCombinerInfo &DCI,
11818-
const ARMSubtarget *Subtarget) {
11817+
TargetLowering::DAGCombinerInfo &DCI) {
1181911818
SDValue N0 = N->getOperand(0);
1182011819
SDValue N1 = N->getOperand(1);
1182111820

@@ -11824,27 +11823,7 @@ static SDValue PerformSUBCombine(SDNode *N,
1182411823
if (SDValue Result = combineSelectAndUse(N, N1, N0, DCI))
1182511824
return Result;
1182611825

11827-
if (!Subtarget->hasMVEIntegerOps() || !N->getValueType(0).isVector())
11828-
return SDValue();
11829-
11830-
// Fold (sub (ARMvmovImm 0), (ARMvdup x)) -> (ARMvdup (sub 0, x))
11831-
// so that we can readily pattern match more mve instructions which can use
11832-
// a scalar operand.
11833-
SDValue VDup = N->getOperand(1);
11834-
if (VDup->getOpcode() != ARMISD::VDUP)
11835-
return SDValue();
11836-
11837-
SDValue VMov = N->getOperand(0);
11838-
if (VMov->getOpcode() == ISD::BITCAST)
11839-
VMov = VMov->getOperand(0);
11840-
11841-
if (VMov->getOpcode() != ARMISD::VMOVIMM || !isZeroVector(VMov))
11842-
return SDValue();
11843-
11844-
SDLoc dl(N);
11845-
SDValue Negate = DCI.DAG.getNode(ISD::SUB, dl, MVT::i32, VMov->getOperand(0),
11846-
VDup->getOperand(0));
11847-
return DCI.DAG.getNode(ARMISD::VDUP, dl, N->getValueType(0), Negate);
11826+
return SDValue();
1184811827
}
1184911828

1185011829
/// PerformVMULCombine
@@ -14529,7 +14508,7 @@ SDValue ARMTargetLowering::PerformDAGCombine(SDNode *N,
1452914508
case ARMISD::ADDE: return PerformADDECombine(N, DCI, Subtarget);
1453014509
case ARMISD::UMLAL: return PerformUMLALCombine(N, DCI.DAG, Subtarget);
1453114510
case ISD::ADD: return PerformADDCombine(N, DCI, Subtarget);
14532-
case ISD::SUB: return PerformSUBCombine(N, DCI, Subtarget);
14511+
case ISD::SUB: return PerformSUBCombine(N, DCI);
1453314512
case ISD::MUL: return PerformMULCombine(N, DCI, Subtarget);
1453414513
case ISD::OR: return PerformORCombine(N, DCI, Subtarget);
1453514514
case ISD::XOR: return PerformXORCombine(N, DCI, Subtarget);
@@ -14887,9 +14866,6 @@ bool ARMTargetLowering::shouldSinkOperands(Instruction *I,
1488714866
case Instruction::Mul:
1488814867
return true;
1488914868
case Instruction::Sub:
14890-
case Instruction::Shl:
14891-
case Instruction::LShr:
14892-
case Instruction::AShr:
1489314869
return Operand == 1;
1489414870
default:
1489514871
return false;

llvm/lib/Target/ARM/ARMInstrMVE.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4304,7 +4304,6 @@ defm MVE_VRSHL_qr : MVE_VxSHL_qr_types<"vrshl", 0b0, 0b1>;
43044304
defm MVE_VQSHL_qr : MVE_VxSHL_qr_types<"vqshl", 0b1, 0b0>;
43054305
defm MVE_VQRSHL_qr : MVE_VxSHL_qr_types<"vqrshl", 0b1, 0b1>;
43064306

4307-
43084307
let Predicates = [HasMVEInt] in {
43094308
def : Pat<(v4i32 (ARMvshlu (v4i32 MQPR:$Qm), (v4i32 (ARMvdup GPR:$Rm)))),
43104309
(v4i32 (MVE_VSHL_qru32 (v4i32 MQPR:$Qm), GPR:$Rm))>;

0 commit comments

Comments
 (0)