From e68e4cbcc50ba7ab8df5e09023f15e6cc2223bef Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 13 Jan 2020 15:32:45 -0800 Subject: [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 --- llvm/lib/CodeGen/MachineFunction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index b147a83cd16..4612690644f 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -484,6 +484,12 @@ uint32_t *MachineFunction::allocateRegMask() { return Mask; } +ArrayRef MachineFunction::allocateShuffleMask(ArrayRef Mask) { + int* AllocMask = Allocator.Allocate(Mask.size()); + copy(Mask, AllocMask); + return {AllocMask, Mask.size()}; +} + #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MachineFunction::dump() const { print(dbgs()); -- cgit v1.2.3