From e7adbcc7a27db6d912e67a2709f48dc501d721c0 Mon Sep 17 00:00:00 2001 From: Hrvoje Varga Date: Wed, 23 Mar 2016 10:29:38 +0000 Subject: [PATCH] [mips][microMIPS] Delay slot filler modifications Differential Revision: http://reviews.llvm.org/D18181 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264147 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MipsDelaySlotFiller.cpp | 6 ++++++ test/CodeGen/Mips/micromips-delay-slot.ll | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/lib/Target/Mips/MipsDelaySlotFiller.cpp b/lib/Target/Mips/MipsDelaySlotFiller.cpp index 2c384b8addb..fe53cad56a7 100644 --- a/lib/Target/Mips/MipsDelaySlotFiller.cpp +++ b/lib/Target/Mips/MipsDelaySlotFiller.cpp @@ -562,6 +562,12 @@ bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) { bool InMicroMipsMode = STI.inMicroMipsMode(); const MipsInstrInfo *TII = STI.getInstrInfo(); + if (InMicroMipsMode && STI.hasMips32r6()) { + // This is microMIPS32r6 or microMIPS64r6 processor. Delay slot for + // branching instructions is not needed. + return Changed; + } + for (Iter I = MBB.begin(); I != MBB.end(); ++I) { if (!hasUnoccupiedSlot(&*I)) continue; diff --git a/test/CodeGen/Mips/micromips-delay-slot.ll b/test/CodeGen/Mips/micromips-delay-slot.ll index ef654623283..5c6aa36a413 100644 --- a/test/CodeGen/Mips/micromips-delay-slot.ll +++ b/test/CodeGen/Mips/micromips-delay-slot.ll @@ -1,5 +1,7 @@ ; RUN: llc -march=mipsel -mcpu=mips32r2 -mattr=+micromips \ ; RUN: -relocation-model=static -O2 < %s | FileCheck %s +; RUN: llc -march=mipsel -mcpu=mips32r6 -mattr=+micromips \ +; RUN: -relocation-model=static -O2 < %s | FileCheck %s -check-prefix=CHECK-MMR6 ; Function Attrs: nounwind define i32 @foo(i32 signext %a) #0 { @@ -16,3 +18,5 @@ declare i32 @bar(i32 signext) #1 ; CHECK: jals ; CHECK-NEXT: sll16 +; CHECK-MMR6: jal +; CHECK-MMR6-NOT: sll16