diff options
author | James Molloy <james.molloy@arm.com> | 2014-06-12 15:18:33 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2014-06-12 15:18:33 +0000 |
commit | 1417b0be3e8fce748a71fd827a2a6a5ce3d9d145 (patch) | |
tree | cf3c2eb23b4da9e65920f35d5933fc52b2b3e2a1 | |
parent | 3d3ea53f32c0638ccd643af3e67807e0a8b325ab (diff) | |
download | llvm-1417b0be3e8fce748a71fd827a2a6a5ce3d9d145.zip llvm-1417b0be3e8fce748a71fd827a2a6a5ce3d9d145.tar.gz llvm-1417b0be3e8fce748a71fd827a2a6a5ce3d9d145.tar.bz2 |
Disable the load/store optimization pass for Thumb-1.
Moritz's changes have improved codegen a lot, but further testing showed significant correctness problems. Disable by default until these have been worked out.
Patch by Moritz Roth!
llvm-svn: 210789
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetMachine.cpp | 10 | ||||
-rw-r--r-- | llvm/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/Thumb/dyn-stackalloc.ll | 7 | ||||
-rw-r--r-- | llvm/test/CodeGen/Thumb/thumb-ldm.ll | 1 | ||||
-rw-r--r-- | llvm/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll | 1 |
5 files changed, 13 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp index 6ef2ea4..c1e866b 100644 --- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp +++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp @@ -265,7 +265,8 @@ bool ARMPassConfig::addInstSelector() { } bool ARMPassConfig::addPreRegAlloc() { - if (getOptLevel() != CodeGenOpt::None) + // FIXME: Temporarily disabling Thumb-1 pre-RA Load/Store optimization pass + if (getOptLevel() != CodeGenOpt::None && !getARMSubtarget().isThumb1Only()) addPass(createARMLoadStoreOptimizationPass(true)); if (getOptLevel() != CodeGenOpt::None && getARMSubtarget().isCortexA9()) addPass(createMLxExpansionPass()); @@ -280,8 +281,11 @@ bool ARMPassConfig::addPreRegAlloc() { bool ARMPassConfig::addPreSched2() { if (getOptLevel() != CodeGenOpt::None) { - addPass(createARMLoadStoreOptimizationPass()); - printAndVerify("After ARM load / store optimizer"); + // FIXME: Temporarily disabling Thumb-1 post-RA Load/Store optimization pass + if (!getARMSubtarget().isThumb1Only()) { + addPass(createARMLoadStoreOptimizationPass()); + printAndVerify("After ARM load / store optimizer"); + } if (getARMSubtarget().hasNEON()) addPass(createExecutionDependencyFixPass(&ARM::DPRRegClass)); diff --git a/llvm/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll b/llvm/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll index 3c43383..ae66369 100644 --- a/llvm/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll +++ b/llvm/test/CodeGen/Thumb/2014-06-10-thumb1-ldst-opt-bug.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -mtriple=thumbv6m-eabi -o - | FileCheck %s +; XFAIL: * define void @foo(i32* %A) #0 { entry: diff --git a/llvm/test/CodeGen/Thumb/dyn-stackalloc.ll b/llvm/test/CodeGen/Thumb/dyn-stackalloc.ll index 6bc39af..6c6de5534 100644 --- a/llvm/test/CodeGen/Thumb/dyn-stackalloc.ll +++ b/llvm/test/CodeGen/Thumb/dyn-stackalloc.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra | FileCheck %s -check-prefix=CHECK -check-prefix=RA_GREEDY -; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra -regalloc=basic | FileCheck %s -check-prefix=CHECK -check-prefix=RA_BASIC +; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra | FileCheck %s +; RUN: llc < %s -mtriple=thumb-apple-darwin -disable-cgp-branch-opts -disable-post-ra -regalloc=basic | FileCheck %s %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* } %struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* } @@ -45,8 +45,7 @@ define void @t2(%struct.comment* %vc, i8* %tag, i8* %contents) { ; CHECK: sub sp, # ; CHECK: mov r[[R0:[0-9]+]], sp ; CHECK: str r{{[0-9+]}}, [r[[R0]] -; RA_GREEDY: str r{{[0-9+]}}, [r[[R0]] -; RA_BASIC: stm r[[R0]]! +; CHECK: str r{{[0-9+]}}, [r[[R0]] ; CHECK-NOT: ldr r0, [sp ; CHECK: mov r[[R1:[0-9]+]], sp ; CHECK: subs r[[R2:[0-9]+]], r[[R1]], r{{[0-9]+}} diff --git a/llvm/test/CodeGen/Thumb/thumb-ldm.ll b/llvm/test/CodeGen/Thumb/thumb-ldm.ll index dd98e6f..95f3edc 100644 --- a/llvm/test/CodeGen/Thumb/thumb-ldm.ll +++ b/llvm/test/CodeGen/Thumb/thumb-ldm.ll @@ -1,4 +1,5 @@ ; RUN: llc < %s -mtriple=thumbv6m-eabi -o - | FileCheck %s +; XFAIL: * @X = external global [0 x i32] ; <[0 x i32]*> [#uses=5] diff --git a/llvm/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll b/llvm/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll index 06cfd9bb..dedc82b 100644 --- a/llvm/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll +++ b/llvm/test/CodeGen/Thumb/thumb-memcpy-ldm-stm.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple=thumbv6m-eabi %s -o - | FileCheck %s +; XFAIL: * @d = external global [64 x i32] @s = external global [64 x i32] |