[llvm] de42307 - [VE] Fix breakage after D118981
Simon Moll via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 15 09:57:29 PST 2022
Author: Simon Moll
Date: 2022-02-15T18:56:20+01:00
New Revision: de42307e442adf5b4a00ab838ab71f37920d2cae
URL: https://github.com/llvm/llvm-project/commit/de42307e442adf5b4a00ab838ab71f37920d2cae
DIFF: https://github.com/llvm/llvm-project/commit/de42307e442adf5b4a00ab838ab71f37920d2cae.diff
LOG: [VE] Fix breakage after D118981
VE backend code expected all VP SDNode to have a mask parameter. This
is not the case with vp.select|merge after D118981.
Added:
Modified:
llvm/lib/Target/VE/VEISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/VE/VEISelLowering.cpp b/llvm/lib/Target/VE/VEISelLowering.cpp
index b55ad83e3dcf1..0585bfa9ae78c 100644
--- a/llvm/lib/Target/VE/VEISelLowering.cpp
+++ b/llvm/lib/Target/VE/VEISelLowering.cpp
@@ -2710,16 +2710,20 @@ SDValue VETargetLowering::lowerToVVP(SDValue Op, SelectionDAG &DAG) const {
if (FromVP) {
// All upstream VP SDNodes always have a mask and avl.
- auto MaskIdx = ISD::getVPMaskIdx(Opcode).getValue();
- auto AVLIdx = ISD::getVPExplicitVectorLengthIdx(Opcode).getValue();
- Mask = Op->getOperand(MaskIdx);
- AVL = Op->getOperand(AVLIdx);
+ auto MaskIdx = ISD::getVPMaskIdx(Opcode);
+ auto AVLIdx = ISD::getVPExplicitVectorLengthIdx(Opcode);
+ if (MaskIdx)
+ Mask = Op->getOperand(*MaskIdx);
+ if (AVLIdx)
+ AVL = Op->getOperand(*AVLIdx);
- } else {
- // Materialize the VL parameter.
+ }
+
+ // Materialize default mask and avl.
+ if (!AVL)
AVL = CDAG.getConstant(OpVecVT.getVectorNumElements(), MVT::i32);
+ if (!Mask)
Mask = CDAG.getConstantMask(Packing, true);
- }
if (isVVPBinaryOp(VVPOpcode)) {
assert(LegalVecVT.isSimple());
More information about the llvm-commits
mailing list