[llvm] [X86] Skip unused VRegs traverse (PR #78229)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 20:12:27 PST 2024


================
@@ -667,7 +667,8 @@ bool X86FastPreTileConfig::runOnMachineFunction(MachineFunction &MFunc) {
   bool HasVirtTileReg = false;
   for (unsigned I = 0, E = NumVirtRegs; I != E; ++I) {
     Register VirtReg = Register::index2VirtReg(I);
-    if (MRI->getRegClass(VirtReg)->getID() == X86::TILERegClassID) {
+    if (!MRI->reg_nodbg_empty(VirtReg) &&
+        MRI->getRegClass(VirtReg)->getID() == X86::TILERegClassID) {
----------------
KanRobert wrote:

Use `isTileRegisterClass`?

https://github.com/llvm/llvm-project/pull/78229


More information about the llvm-commits mailing list