From 63496f66c5b528a48f8da7714ee3f635f8aadd18 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Sat, 13 Apr 2013 23:06:15 +0000 Subject: Mark all PPC CR registers to be spilled as live-in and tag MFCR appropriately Leaving MFCR has having unmodeled side effects is not enough to prevent unwanted instruction reordering post-RA. We could probably apply a stronger barrier attribute, but there is a better way: Add all (not just the first) CR to be spilled as live-in to the entry block, and add all CRs to the MFCR instruction as implicitly killed. Unfortunately, I don't have a small test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179465 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCInstr64Bit.td | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/Target/PowerPC/PPCInstr64Bit.td') diff --git a/lib/Target/PowerPC/PPCInstr64Bit.td b/lib/Target/PowerPC/PPCInstr64Bit.td index 88da067e2a..9bcd19a937 100644 --- a/lib/Target/PowerPC/PPCInstr64Bit.td +++ b/lib/Target/PowerPC/PPCInstr64Bit.td @@ -256,11 +256,7 @@ def MFCR8pseud: XFXForm_3<31, 19, (outs G8RC:$rT), (ins crbitm:$FXM), PPC970_MicroCode, PPC970_Unit_CRU; } // neverHasSideEffects = 1 -// MFCR uses all CR registers, but marking that explicitly causes -// problems because some of them appear to be undefined. Because -// this form is used only in prologue code, just mark it as having -// side effects. -let /* Uses = [CR0, CR1, CR2, CR3, CR4, CR5, CR6] */ hasSideEffects = 1 in +let neverHasSideEffects = 1 in def MFCR8 : XFXForm_3<31, 19, (outs G8RC:$rT), (ins), "mfcr $rT", SprMFCR>, PPC970_MicroCode, PPC970_Unit_CRU; -- cgit v1.2.3