Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | bool SelectDupZeroOrUndef(SDValue N) { | ||||
} | } | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
bool SelectDupZero(SDValue N) { | |||||
switch(N->getOpcode()) { | |||||
case AArch64ISD::DUP: | |||||
sdesmalen: BUILD_VECTOR only works for fixed-width vectors, so you'll need to check for SPLAT_VECTOR… | |||||
Hmm, that's strange. I assumed there was a separate missing lowering somewhere for zeroinitializer. I've definitely seen other DestructiveInstr types matching DUP/SPLAT there. Maybe I missed something subtle in this patch. Will check it out... cameron.mcinally: Hmm, that's strange. I assumed there was a separate missing lowering somewhere for… | |||||
Ah, got it. ISel is missing support for FP splat_vectors. I'll do that under a separate Diff, assuming I can find a good way to add standalone tests for the splat_vectors... cameron.mcinally: Ah, got it. ISel is missing support for FP splat_vectors.
I'll do that under a separate Diff… | |||||
Not Done ReplyInline ActionsThanks for fixing this and adding the support for splat_vectors in the other patch! sdesmalen: Thanks for fixing this and adding the support for splat_vectors in the other patch! | |||||
case ISD::SPLAT_VECTOR: { | |||||
auto Opnd0 = N->getOperand(0); | |||||
if (auto CN = dyn_cast<ConstantSDNode>(Opnd0)) | |||||
if (CN->isNullValue()) | |||||
return true; | |||||
if (auto CN = dyn_cast<ConstantFPSDNode>(Opnd0)) | |||||
if (CN->isZero()) | |||||
return true; | |||||
} | |||||
Not Done ReplyInline Actionsnit: missing either break; or otherwise LLVM_FALLTHROUGH statement here. sdesmalen: nit: missing either `break;` or otherwise `LLVM_FALLTHROUGH` statement here. | |||||
default: | |||||
break; | |||||
} | |||||
return false; | |||||
} | |||||
template<MVT::SimpleValueType VT> | template<MVT::SimpleValueType VT> | ||||
bool SelectSVEAddSubImm(SDValue N, SDValue &Imm, SDValue &Shift) { | bool SelectSVEAddSubImm(SDValue N, SDValue &Imm, SDValue &Shift) { | ||||
return SelectSVEAddSubImm(N, VT, Imm, Shift); | return SelectSVEAddSubImm(N, VT, Imm, Shift); | ||||
} | } | ||||
template<MVT::SimpleValueType VT> | template<MVT::SimpleValueType VT> | ||||
bool SelectSVELogicalImm(SDValue N, SDValue &Imm) { | bool SelectSVELogicalImm(SDValue N, SDValue &Imm) { | ||||
return SelectSVELogicalImm(N, VT, Imm); | return SelectSVELogicalImm(N, VT, Imm); | ||||
▲ Show 20 Lines • Show All 4,378 Lines • Show Last 20 Lines |
BUILD_VECTOR only works for fixed-width vectors, so you'll need to check for SPLAT_VECTOR instead.
This also puzzles me a bit on how the tests could pass; I'd either expect the pattern not to match because the incoming value is not a BUILD_VECTOR, or I'd expect an assertion in BUILD_VECTOR to fail because it doesn't work with scalable vectors.