From 5be39223216298009799d4a51ed8669934685d58 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 24 Sep 2010 22:03:46 +0000 Subject: [PATCH] Fix scheduling itinerary for pseudo mov immediate instructions which expand into two real instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114766 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMInstrInfo.td | 6 ++++-- lib/Target/ARM/ARMInstrThumb2.td | 6 +++--- lib/Target/ARM/ARMSchedule.td | 1 + lib/Target/ARM/ARMScheduleA8.td | 2 ++ lib/Target/ARM/ARMScheduleA9.td | 2 ++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/Target/ARM/ARMInstrInfo.td b/lib/Target/ARM/ARMInstrInfo.td index c467df82953..b6064ef6368 100644 --- a/lib/Target/ARM/ARMInstrInfo.td +++ b/lib/Target/ARM/ARMInstrInfo.td @@ -2729,9 +2729,11 @@ def Int_eh_sjlj_longjmp : XI<(outs), (ins GPR:$src, GPR:$scratch), // Large immediate handling. // Two piece so_imms. +// FIXME: Expand this in ARMExpandPseudoInsts. +// FIXME: Remove this when we can do generalized remat. let isReMaterializable = 1 in def MOVi2pieces : AI1x2<(outs GPR:$dst), (ins so_imm2part:$src), - Pseudo, IIC_iMOVi, + Pseudo, IIC_iMOVix2, "mov", "\t$dst, $src", [(set GPR:$dst, so_imm2part:$src)]>, Requires<[IsARM, NoV6T2]>; @@ -2754,7 +2756,7 @@ def : ARMPat<(add GPR:$LHS, so_neg_imm2part:$RHS), // as a single unit instead of having to handle reg inputs. // FIXME: Remove this when we can do generalized remat. let isReMaterializable = 1 in -def MOVi32imm : AI1x2<(outs GPR:$dst), (ins i32imm:$src), Pseudo, IIC_iMOVi, +def MOVi32imm : AI1x2<(outs GPR:$dst), (ins i32imm:$src), Pseudo, IIC_iMOVix2, "movw", "\t$dst, ${src:lo16}\n\tmovt${p}\t$dst, ${src:hi16}", [(set GPR:$dst, (i32 imm:$src))]>, Requires<[IsARM, HasV6T2]>; diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td index 6a5078c21b6..0534097d438 100644 --- a/lib/Target/ARM/ARMInstrThumb2.td +++ b/lib/Target/ARM/ARMInstrThumb2.td @@ -2689,10 +2689,10 @@ def : T2Pat<(add rGPR:$LHS, t2_so_neg_imm2part:$RHS), (t2_so_neg_imm2part_2 imm:$RHS))>; // 32-bit immediate using movw + movt. -// This is a single pseudo instruction to make it re-materializable. Remove -// when we can do generalized remat. +// This is a single pseudo instruction to make it re-materializable. +// FIXME: Remove this when we can do generalized remat. let isReMaterializable = 1 in -def t2MOVi32imm : T2Ix2<(outs rGPR:$dst), (ins i32imm:$src), IIC_iMOVi, +def t2MOVi32imm : T2Ix2<(outs rGPR:$dst), (ins i32imm:$src), IIC_iMOVix2, "movw", "\t$dst, ${src:lo16}\n\tmovt${p}\t$dst, ${src:hi16}", [(set rGPR:$dst, (i32 imm:$src))]>; diff --git a/lib/Target/ARM/ARMSchedule.td b/lib/Target/ARM/ARMSchedule.td index 6151008da68..4b02e945f75 100644 --- a/lib/Target/ARM/ARMSchedule.td +++ b/lib/Target/ARM/ARMSchedule.td @@ -23,6 +23,7 @@ def IIC_iCMPr : InstrItinClass; def IIC_iCMPsi : InstrItinClass; def IIC_iCMPsr : InstrItinClass; def IIC_iMOVi : InstrItinClass; +def IIC_iMOVix2 : InstrItinClass; def IIC_iMOVr : InstrItinClass; def IIC_iMOVsi : InstrItinClass; def IIC_iMOVsr : InstrItinClass; diff --git a/lib/Target/ARM/ARMScheduleA8.td b/lib/Target/ARM/ARMScheduleA8.td index 2902fbbad0f..179c121ca03 100644 --- a/lib/Target/ARM/ARMScheduleA8.td +++ b/lib/Target/ARM/ARMScheduleA8.td @@ -50,6 +50,8 @@ def CortexA8Itineraries : ProcessorItineraries< // // Move instructions, unconditional InstrItinData], [1]>, + InstrItinData, + InstrStage<1, [A8_Pipe0, A8_Pipe1]>], [1]>, InstrItinData], [1, 1]>, InstrItinData], [1, 1]>, InstrItinData], [1, 1, 1]>, diff --git a/lib/Target/ARM/ARMScheduleA9.td b/lib/Target/ARM/ARMScheduleA9.td index 4a764cc8117..b37b3948f17 100644 --- a/lib/Target/ARM/ARMScheduleA9.td +++ b/lib/Target/ARM/ARMScheduleA9.td @@ -32,6 +32,8 @@ def CortexA9Itineraries : ProcessorItineraries< // // Move instructions, unconditional InstrItinData], [1]>, + InstrItinData, + InstrStage<1, [A9_Pipe0, A9_Pipe1]>], [1]>, InstrItinData], [1, 1]>, InstrItinData], [1, 1]>, InstrItinData], [2, 2, 1]>, -- 2.34.1