Add option disable-mips-delay-filler. Turn on mips' delay slot filler by

default.

Patch by Carl Norum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka 2012-08-22 02:51:28 +00:00
parent c8f267f669
commit 6522a9e04b
7 changed files with 18 additions and 15 deletions

View File

@ -30,10 +30,11 @@ STATISTIC(FilledSlots, "Number of delay slots filled");
STATISTIC(UsefulSlots, "Number of delay slots filled with instructions that"
" are not NOP.");
static cl::opt<bool> EnableDelaySlotFiller(
"enable-mips-delay-filler",
static cl::opt<bool> DisableDelaySlotFiller(
"disable-mips-delay-filler",
cl::init(false),
cl::desc("Fill the Mips delay slots useful instructions."),
cl::desc("Disable the delay slot filler, which attempts to fill the Mips"
"delay slots with useful instructions."),
cl::Hidden);
// This option can be used to silence complaints by machine verifier passes.
@ -114,7 +115,7 @@ runOnMachineBasicBlock(MachineBasicBlock &MBB) {
InstrIter D;
if (EnableDelaySlotFiller && findDelayInstr(MBB, I, D)) {
if (!DisableDelaySlotFiller && findDelayInstr(MBB, I, D)) {
MBB.splice(llvm::next(I), &MBB, D);
++UsefulSlots;
} else

View File

@ -1,4 +1,4 @@
; RUN: llc -march=mipsel -enable-mips-delay-filler < %s | FileCheck %s
; RUN: llc -march=mipsel < %s | FileCheck %s
define void @foo1() nounwind {
entry:

View File

@ -1,4 +1,4 @@
; RUN: llc -march=mipsel -relocation-model=pic < %s | FileCheck %s
; RUN: llc -march=mipsel -relocation-model=pic -disable-mips-delay-filler < %s | FileCheck %s
@foo = thread_local global i32 42
@bar = hidden alias i32* @foo

View File

@ -1,8 +1,10 @@
; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=PIC
; RUN: llc -march=mipsel -relocation-model=static < %s \
; RUN: | FileCheck %s -check-prefix=STATIC
; RUN: llc -march=mipsel -relocation-model=static < %s \
; RUN: -mips-fix-global-base-reg=false | FileCheck %s -check-prefix=STATICGP
; RUN: llc -march=mipsel -disable-mips-delay-filler < %s | \
; RUN: FileCheck %s -check-prefix=PIC
; RUN: llc -march=mipsel -relocation-model=static -disable-mips-delay-filler < \
; RUN: %s | FileCheck %s -check-prefix=STATIC
; RUN: llc -march=mipsel -relocation-model=static -disable-mips-delay-filler \
; RUN: -mips-fix-global-base-reg=false < %s | \
; RUN: FileCheck %s -check-prefix=STATICGP
@t1 = thread_local global i32 0, align 4

View File

@ -1,4 +1,4 @@
; RUN: llc -filetype=obj -march=mips64el -mcpu=mips64 %s -o - | elf-dump --dump-section-data | FileCheck %s
; RUN: llc -filetype=obj -march=mips64el -mcpu=mips64 -disable-mips-delay-filler %s -o - | elf-dump --dump-section-data | FileCheck %s
; Check for N64 relocation production.
;

View File

@ -1,4 +1,4 @@
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 %s -o - | llvm-objdump -disassemble -triple mips64el - | FileCheck %s
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 -disable-mips-delay-filler %s -o - | llvm-objdump -disassemble -triple mips64el - | FileCheck %s
define i64 @f3(i64 %a0) nounwind readnone {

View File

@ -1,8 +1,8 @@
; There is no real check here. If the test doesn't
; assert it passes.
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 < %s
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 -disable-mips-delay-filler < %s
; Run it again without extra nop in delay slot
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 -enable-mips-delay-filler < %s
; RUN: llc -march=mips64el -filetype=obj -mcpu=mips64r2 < %s
define i32 @bosco1(i32 %x) nounwind readnone {
entry: