Tentatively apply https://reviews.llvm.org/D78877 (by Dave Green):

[ARM] Only produce qadd8b under hasV6Ops

  When compiling for a arm5te cpu from clang, the +dsp attribute is
  set. This meant we could try and generate qadd8 instructions where we
  would end up having no pattern. I've changed the condition here to be
  hasV6Ops && hasDSP, which is what other parts of ARMISelLowering seem
  to use for similar instructions.

  Fixed PR45677.

This fixes "fatal error: error in backend: Cannot select: t37: i32 =
ARMISD::QADD8b t43, t44" when compiling sys/dev/sound/pcm/feeder_mixer.c
for armv5. For some reason we do not encounter this on head, but this
error popped up while building universes for stable/12.

MFC after:	3 days
This commit is contained in:
dim 2020-04-26 19:17:45 +00:00
parent c16a201cb8
commit 60f97c61b7

View File

@ -4549,7 +4549,7 @@ SDValue ARMTargetLowering::LowerUnsignedALUO(SDValue Op,
static SDValue LowerSADDSUBSAT(SDValue Op, SelectionDAG &DAG, static SDValue LowerSADDSUBSAT(SDValue Op, SelectionDAG &DAG,
const ARMSubtarget *Subtarget) { const ARMSubtarget *Subtarget) {
EVT VT = Op.getValueType(); EVT VT = Op.getValueType();
if (!Subtarget->hasDSP()) if (!Subtarget->hasV6Ops() || !Subtarget->hasDSP())
return SDValue(); return SDValue();
if (!VT.isSimple()) if (!VT.isSimple())
return SDValue(); return SDValue();