[PATCH] D27271: [AArch64] Fold more spilled/refilled COPYs.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 14:03:32 PST 2016


MatzeB accepted this revision.
MatzeB added a comment.

LGTM as well. Two comments:



================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:2636
+                 ? MRI.getRegClass(Reg)
+                 : TRI.getMinimalPhysRegClass(Reg);
+    };
----------------
I always have a bad feeling about performance when getMinimalPhysRegClass() is used because that function does a linear search through the register classes. However looking around I couldn't find any better way to do what you want to do here. So I'm fine with it for now.


================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:2645
+      } else {
+        assert(Ops[0] == 1);
+        loadRegFromStackSlot(MBB, InsertPt, DstReg, FrameIndex, &DstRC, &TRI);
----------------
I would make this an actual check instead of an assert. While I have never seen it in practice, I think in theory we could have implicit defs/uses to the COPY instruction at later positions.


https://reviews.llvm.org/D27271





More information about the llvm-commits mailing list