From a99cceb49efd541dc5c83b6ee824d5ffba46be05 Mon Sep 17 00:00:00 2001 From: "Kazushi (Jam) Marukawa" Date: Tue, 23 Jan 2024 22:42:49 +0900 Subject: [PATCH] Change computeRegUnitLaneMasks Change computeRegUnitLaneMasks to partially revert D157864 modification since this cause some problems on VE backend. https://github.com/llvm/llvm-project/issues/78942#issuecomment-1905837614 --- llvm/utils/TableGen/CodeGenRegisters.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp index 2d5f5c841a17..a53f3cb6305e 100644 --- a/llvm/utils/TableGen/CodeGenRegisters.cpp +++ b/llvm/utils/TableGen/CodeGenRegisters.cpp @@ -2124,7 +2124,7 @@ void CodeGenRegBank::computeRegUnitLaneMasks() { // Create an initial lane mask for all register units. const auto &RegUnits = Register.getRegUnits(); CodeGenRegister::RegUnitLaneMaskList RegUnitLaneMasks( - RegUnits.count(), LaneBitmask::getAll()); + RegUnits.count(), LaneBitmask::getNone()); // Iterate through SubRegisters. typedef CodeGenRegister::SubRegMap SubRegMap; const SubRegMap &SubRegs = Register.getSubRegs(); @@ -2143,7 +2143,7 @@ void CodeGenRegBank::computeRegUnitLaneMasks() { unsigned u = 0; for (unsigned RU : RegUnits) { if (SUI == RU) { - RegUnitLaneMasks[u] &= LaneMask; + RegUnitLaneMasks[u] |= LaneMask; assert(!Found); Found = true; } @@ -2153,6 +2153,10 @@ void CodeGenRegBank::computeRegUnitLaneMasks() { assert(Found); } } + for (auto &Mask : RegUnitLaneMasks) { + if (Mask.none()) + Mask = LaneBitmask::getAll(); + } Register.setRegUnitLaneMasks(RegUnitLaneMasks); } }