[PATCH] D33294: Only enable LiveRangeShrink for x86.
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 17 12:05:20 PDT 2017
danielcdh created this revision.
Herald added subscribers: javed.absar, jyknight, jholewinski.
Moving LiveRangeShrink to x86 as this pass is mostly useful for archtectures with great register pressure.
https://reviews.llvm.org/D33294
Files:
lib/CodeGen/TargetPassConfig.cpp
lib/Target/X86/X86TargetMachine.cpp
test/CodeGen/AArch64/arm64-ccmp.ll
test/CodeGen/NVPTX/sched1.ll
test/CodeGen/NVPTX/sched2.ll
test/CodeGen/SPARC/LeonItinerariesUT.ll
Index: test/CodeGen/SPARC/LeonItinerariesUT.ll
===================================================================
--- test/CodeGen/SPARC/LeonItinerariesUT.ll
+++ test/CodeGen/SPARC/LeonItinerariesUT.ll
@@ -28,8 +28,8 @@
; LEON3_4_ITIN-LABEL: f32_ops:
; LEON3_4_ITIN: ld
; LEON3_4_ITIN-NEXT: ld
-; LEON3_4_ITIN-NEXT: fadds
; LEON3_4_ITIN-NEXT: ld
+; LEON3_4_ITIN-NEXT: fadds
; LEON3_4_ITIN-NEXT: ld
; LEON3_4_ITIN-NEXT: fsubs
; LEON3_4_ITIN-NEXT: fmuls
Index: test/CodeGen/NVPTX/sched2.ll
===================================================================
--- test/CodeGen/NVPTX/sched2.ll
+++ test/CodeGen/NVPTX/sched2.ll
@@ -4,12 +4,12 @@
; CHECK: .func foo
; CHECK: ld.v2.u32
; CHECK-NEXT: ld.v2.u32
+; CHECK-NEXT: ld.v2.u32
+; CHECK-NEXT: ld.v2.u32
; CHECK-NEXT: add.s32
; CHECK-NEXT: add.s32
-; CHECK-NEXT: ld.v2.u32
; CHECK-NEXT: add.s32
; CHECK-NEXT: add.s32
-; CHECK-NEXT: ld.v2.u32
; CHECK-NEXT: add.s32
; CHECK-NEXT: add.s32
%ptr0 = getelementptr <2 x i32>, <2 x i32>* %a, i32 0
Index: test/CodeGen/NVPTX/sched1.ll
===================================================================
--- test/CodeGen/NVPTX/sched1.ll
+++ test/CodeGen/NVPTX/sched1.ll
@@ -6,11 +6,11 @@
; CHECK: .func foo
; CHECK: ld.u32
; CHECK-NEXT: ld.u32
-; CHECK-NEXT: add.s32
; CHECK-NEXT: ld.u32
-; CHECK-NEXT: add.s32
; CHECK-NEXT: ld.u32
; CHECK-NEXT: add.s32
+; CHECK-NEXT: add.s32
+; CHECK-NEXT: add.s32
%ptr0 = getelementptr i32, i32* %a, i32 0
%val0 = load i32, i32* %ptr0
%ptr1 = getelementptr i32, i32* %a, i32 1
Index: test/CodeGen/AArch64/arm64-ccmp.ll
===================================================================
--- test/CodeGen/AArch64/arm64-ccmp.ll
+++ test/CodeGen/AArch64/arm64-ccmp.ll
@@ -378,11 +378,11 @@
; CHECK-NEXT: cmp x0, #13
; CHECK-NOT: ccmp
; CHECK-NEXT: cset [[REG1:w[0-9]+]], gt
-; CHECK-NEXT: and [[REG4:w[0-9]+]], [[REG0]], [[REG1]]
; CHECK-NEXT: cmp x2, #2
; CHECK-NEXT: cset [[REG2:w[0-9]+]], lt
; CHECK-NEXT: cmp x2, #4
; CHECK-NEXT: cset [[REG3:w[0-9]+]], gt
+; CHECK-NEXT: and [[REG4:w[0-9]+]], [[REG0]], [[REG1]]
; CHECK-NEXT: and [[REG5:w[0-9]+]], [[REG2]], [[REG3]]
; CHECK-NEXT: orr [[REG6:w[0-9]+]], [[REG4]], [[REG5]]
; CHECK-NEXT: cmp [[REG6]], #0
Index: lib/Target/X86/X86TargetMachine.cpp
===================================================================
--- lib/Target/X86/X86TargetMachine.cpp
+++ lib/Target/X86/X86TargetMachine.cpp
@@ -438,6 +438,7 @@
void X86PassConfig::addPreRegAlloc() {
if (getOptLevel() != CodeGenOpt::None) {
+ addPass(&LiveRangeShrinkID);
addPass(createX86FixupSetCC());
addPass(createX86OptimizeLEAs());
addPass(createX86CallFrameOptimization());
Index: lib/CodeGen/TargetPassConfig.cpp
===================================================================
--- lib/CodeGen/TargetPassConfig.cpp
+++ lib/CodeGen/TargetPassConfig.cpp
@@ -610,9 +610,6 @@
addPass(&LocalStackSlotAllocationID, false);
}
- if (getOptLevel() != CodeGenOpt::None)
- addPass(&LiveRangeShrinkID);
-
// Run pre-ra passes.
addPreRegAlloc();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33294.99334.patch
Type: text/x-patch
Size: 3084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170517/1fa00050/attachment.bin>
More information about the llvm-commits
mailing list