Skip to content

Commit

Permalink
Fix a bug related to constant islands for Mips16 and mips16/32 dual m…
Browse files Browse the repository at this point in the history
…ode.

The determination of when we are doing constant pools was being made too
early in the asm printer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195781 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Reed Kotler committed Nov 26, 2013
1 parent d0d8d64 commit c0dfa22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/Target/Mips/MipsAsmPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
/// pool entries so we can properly mark them as data regions.
bool InConstantPool;

bool UsingConstantPools;

public:

Expand All @@ -62,8 +61,6 @@ class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
: AsmPrinter(TM, Streamer), MCP(0), InConstantPool(false),
MCInstLowering(*this) {
Subtarget = &TM.getSubtarget<MipsSubtarget>();
UsingConstantPools =
(Subtarget->inMips16Mode() && Subtarget->useConstantIslands());
}

virtual const char *getPassName() const {
Expand All @@ -73,6 +70,8 @@ class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
virtual bool runOnMachineFunction(MachineFunction &MF);

virtual void EmitConstantPool() LLVM_OVERRIDE {
bool UsingConstantPools =
(Subtarget->inMips16Mode() && Subtarget->useConstantIslands());
if (!UsingConstantPools)
AsmPrinter::EmitConstantPool();
// we emit constant pools customly!
Expand Down
6 changes: 5 additions & 1 deletion test/CodeGen/Mips/fpnotneeded.ll
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
; RUN: llc -march=mipsel -mcpu=mips32 -relocation-model=static -O3 < %s -mips-os16 | FileCheck %s -check-prefix=32
; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips32 -relocation-model=static -O3 < %s -mips-os16 | FileCheck %s -check-prefix=32

; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips32 -relocation-model=static -O3 -mips16-constant-islands < %s -mips-os16 | FileCheck %s -check-prefix=cisle

@i = global i32 1, align 4
@f = global float 1.000000e+00, align 4
Expand Down Expand Up @@ -57,6 +59,8 @@ entry:
; 32: restore {{.+}}
; 32: .end foo

; cisle: .end foo

attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }


Expand Down

0 comments on commit c0dfa22

Please sign in to comment.