[PATCH] D27002: [AArch64] Handle more zero reg cases in foldMemoryOperandImpl

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 15:12:25 PST 2016


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

LGTM, with nitpicks. And obviously needs https://reviews.llvm.org/D26521 to be accepted first.



================
Comment at: lib/Target/AArch64/AArch64InstrInfo.cpp:2636-2637
+        MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
+        const TargetRegisterInfo *TRI = &getRegisterInfo();
+        const TargetRegisterClass *DstRC = MRI.getRegClass(DstMO.getReg());
+        const TargetRegisterClass *SpillRC;
----------------
Maybe use reference variables to indicate they cannot contain nullptr.


================
Comment at: test/CodeGen/MIR/AArch64/spill-fold-zr.mir:13
+  bb.0:
+    ; CHECK: STRXui %xzr
+    undef %0.sub_32 = COPY %wzr
----------------
A sentece describing what you are testing here would be nice.


================
Comment at: test/CodeGen/MIR/AArch64/spill-fold-zr.mir:15
+    undef %0.sub_32 = COPY %wzr
+    INLINEASM $nop, 1, 12, implicit-def dead early-clobber %x0, 12, implicit-def dead early-clobber %x1, 12, implicit-def dead early-clobber %x2, 12, implicit-def dead early-clobber %x3, 12, implicit-def dead early-clobber %x4, 12, implicit-def dead early-clobber %x5, 12, implicit-def dead early-clobber %x6, 12, implicit-def dead early-clobber %x7, 12, implicit-def dead early-clobber %x8, 12, implicit-def dead early-clobber %x9, 12, implicit-def dead early-clobber %x10, 12, implicit-def dead early-clobber %x11, 12, implicit-def dead early-clobber %x12, 12, implicit-def dead early-clobber %x13, 12, implicit-def dead early-clobber %x14, 12, implicit-def dead early-clobber %x15, 12, implicit-def dead early-clobber %x16, 12, implicit-def dead early-clobber %x17, 12, implicit-def dead early-clobber %x18, 12, implicit-def dead early-clobber %x19, 12, implicit-def dead early-clobber %x20, 12, implicit-def dead early-clobber %x21, 12, implicit-def dead early-clobber %x22, 12, implicit-def dead early-clobber %x23, 12, implicit-def dead early-clobber %x24, 12, implicit-def dead early-clobber %x25, 12, implicit-def dead early-clobber %x26, 12, implicit-def dead early-clobber %x27, 12, implicit-def dead early-clobber %x28, 12, implicit-def dead early-clobber %fp, 12, implicit-def dead early-clobber %lr, 12, implicit-def early-clobber %sp
+    %x0 = COPY %0
----------------
Do the defs need to be early clobbers? I would have assumed it doesn't matter...


https://reviews.llvm.org/D27002





More information about the llvm-commits mailing list