diff options
author | Eli Friedman <efriedma@quicinc.com> | 2020-01-13 15:32:45 -0800 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2020-01-13 16:55:41 -0800 |
commit | e68e4cbcc50ba7ab8df5e09023f15e6cc2223bef (patch) | |
tree | c060df72c78b35ee0942dac9e9408add9fb55168 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 989bed989a41732d1b70314bd9063ccd6e74fe5c (diff) | |
download | bcm5719-llvm-e68e4cbcc50ba7ab8df5e09023f15e6cc2223bef.tar.gz bcm5719-llvm-e68e4cbcc50ba7ab8df5e09023f15e6cc2223bef.zip |
[GlobalISel] Change representation of shuffle masks in MachineOperand.
We're planning to remove the shufflemask operand from ShuffleVectorInst
(D72467); fix GlobalISel so it doesn't depend on that Constant.
The change to prelegalizercombiner-shuffle-vector.mir happens because
the input contains a literal "-1" in the mask (so the parser/verifier
weren't really handling it properly). We now treat it as equivalent to
"undef" in all contexts.
Differential Revision: https://reviews.llvm.org/D72663
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index b2534c2e53d..6c0402df848 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1407,18 +1407,6 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) { break; } - const Constant *Mask = MaskOp.getShuffleMask(); - auto *MaskVT = dyn_cast<VectorType>(Mask->getType()); - if (!MaskVT || !MaskVT->getElementType()->isIntegerTy(32)) { - report("Invalid shufflemask constant type", MI); - break; - } - - if (!Mask->getAggregateElement(0u)) { - report("Invalid shufflemask constant type", MI); - break; - } - LLT DstTy = MRI->getType(MI->getOperand(0).getReg()); LLT Src0Ty = MRI->getType(MI->getOperand(1).getReg()); LLT Src1Ty = MRI->getType(MI->getOperand(2).getReg()); @@ -1434,8 +1422,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) { int SrcNumElts = Src0Ty.isVector() ? Src0Ty.getNumElements() : 1; int DstNumElts = DstTy.isVector() ? DstTy.getNumElements() : 1; - SmallVector<int, 32> MaskIdxes; - ShuffleVectorInst::getShuffleMask(Mask, MaskIdxes); + ArrayRef<int> MaskIdxes = MaskOp.getShuffleMask(); if (static_cast<int>(MaskIdxes.size()) != DstNumElts) report("Wrong result type for shufflemask", MI); |