diff options
author | Reed Kotler <rkotler@mips.com> | 2013-11-26 20:38:40 +0000 |
---|---|---|
committer | Reed Kotler <rkotler@mips.com> | 2013-11-26 20:38:40 +0000 |
commit | c0dfa22e199304e314cbde3192870b58fbf9830c (patch) | |
tree | ec96fec394abd42cd65e5da118edc23cbeb69f14 | |
parent | d0d8d6462adacedff6c57e34ee5c3b5fdc9ed71f (diff) | |
download | llvm-c0dfa22e199304e314cbde3192870b58fbf9830c.tar.gz llvm-c0dfa22e199304e314cbde3192870b58fbf9830c.tar.bz2 llvm-c0dfa22e199304e314cbde3192870b58fbf9830c.tar.xz |
Fix a bug related to constant islands for Mips16 and mips16/32 dual mode.
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
-rw-r--r-- | lib/Target/Mips/MipsAsmPrinter.h | 5 | ||||
-rw-r--r-- | test/CodeGen/Mips/fpnotneeded.ll | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/Target/Mips/MipsAsmPrinter.h b/lib/Target/Mips/MipsAsmPrinter.h index 11c6acd208..b3060ad930 100644 --- a/lib/Target/Mips/MipsAsmPrinter.h +++ b/lib/Target/Mips/MipsAsmPrinter.h @@ -50,7 +50,6 @@ private: /// pool entries so we can properly mark them as data regions. bool InConstantPool; - bool UsingConstantPools; public: @@ -62,8 +61,6 @@ public: : AsmPrinter(TM, Streamer), MCP(0), InConstantPool(false), MCInstLowering(*this) { Subtarget = &TM.getSubtarget<MipsSubtarget>(); - UsingConstantPools = - (Subtarget->inMips16Mode() && Subtarget->useConstantIslands()); } virtual const char *getPassName() const { @@ -73,6 +70,8 @@ public: 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! diff --git a/test/CodeGen/Mips/fpnotneeded.ll b/test/CodeGen/Mips/fpnotneeded.ll index b4fab64142..6a4363c581 100644 --- a/test/CodeGen/Mips/fpnotneeded.ll +++ b/test/CodeGen/Mips/fpnotneeded.ll @@ -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 @@ -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" } |