[PATCH] D15930: Prevent renaming of CR fields in AADB when a CR restore is present

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 11:05:01 PST 2016


nemanjai created this revision.
nemanjai added reviewers: hfinkel, wschmidt, seurer, kbarton.
nemanjai added a subscriber: llvm-commits.
nemanjai set the repository for this revision to rL LLVM.

A few months ago, a "regression" was introduced in the PPC back end with a change that someone made to target-independent code. Of course, the offending changeset was correct and the issue was when Aggressive Anti-Dependence Breaking gets a hold of CR fields. Namely, it will rename the CR field in the def and all the uses but when restoring the value, the position of the nibble in the source GPR is important. In that case, renaming the CR field is not valid since the MTOCRF will end up populating the field with undefined bits.

Repository:
  rL LLVM

http://reviews.llvm.org/D15930

Files:
  lib/Target/PowerPC/PPCInstr64Bit.td
  lib/Target/PowerPC/PPCInstrInfo.td

Index: lib/Target/PowerPC/PPCInstrInfo.td
===================================================================
--- lib/Target/PowerPC/PPCInstrInfo.td
+++ lib/Target/PowerPC/PPCInstrInfo.td
@@ -2299,6 +2299,7 @@
                      "#RESTORE_VRSAVE", []>;
 
 let hasSideEffects = 0 in {
+let hasExtraDefRegAllocReq = 1 in // to enable post-ra anti-dep breaking.
 def MTOCRF: XFXForm_5a<31, 144, (outs crbitm:$FXM), (ins gprc:$ST),
                        "mtocrf $FXM, $ST", IIC_BrMCRX>,
             PPC970_DGroup_First, PPC970_Unit_CRU;
Index: lib/Target/PowerPC/PPCInstr64Bit.td
===================================================================
--- lib/Target/PowerPC/PPCInstr64Bit.td
+++ lib/Target/PowerPC/PPCInstr64Bit.td
@@ -299,6 +299,7 @@
 // 64-bit CR instructions
 let Interpretation64Bit = 1, isCodeGenOnly = 1 in {
 let hasSideEffects = 0 in {
+let hasExtraDefRegAllocReq = 1 in // to enable post-ra anti-dep breaking.
 def MTOCRF8: XFXForm_5a<31, 144, (outs crbitm:$FXM), (ins g8rc:$ST),
                         "mtocrf $FXM, $ST", IIC_BrMCRX>,
             PPC970_DGroup_First, PPC970_Unit_CRU;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15930.44133.patch
Type: text/x-patch
Size: 1113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160106/d4074031/attachment.bin>


More information about the llvm-commits mailing list