summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineOperand.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2020-01-13 15:32:45 -0800
committerEli Friedman <efriedma@quicinc.com>2020-01-13 16:55:41 -0800
commite68e4cbcc50ba7ab8df5e09023f15e6cc2223bef (patch)
treec060df72c78b35ee0942dac9e9408add9fb55168 /llvm/lib/CodeGen/MachineOperand.cpp
parent989bed989a41732d1b70314bd9063ccd6e74fe5c (diff)
downloadbcm5719-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/MachineOperand.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOperand.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp
index 0ea495bf0c0..7b8f0110092 100644
--- a/llvm/lib/CodeGen/MachineOperand.cpp
+++ b/llvm/lib/CodeGen/MachineOperand.cpp
@@ -930,13 +930,13 @@ void MachineOperand::print(raw_ostream &OS, ModuleSlotTracker &MST,
}
case MachineOperand::MO_ShuffleMask:
OS << "shufflemask(";
- const Constant* C = getShuffleMask();
- const int NumElts = C->getType()->getVectorNumElements();
-
+ ArrayRef<int> Mask = getShuffleMask();
StringRef Separator;
- for (int I = 0; I != NumElts; ++I) {
- OS << Separator;
- C->getAggregateElement(I)->printAsOperand(OS, false, MST);
+ for (int Elt : Mask) {
+ if (Elt == -1)
+ OS << Separator << "undef";
+ else
+ OS << Separator << Elt;
Separator = ", ";
}
OpenPOWER on IntegriCloud