[llvm] r195781 - Fix a bug related to constant islands for Mips16 and mips16/32 dual mode.

Reed Kotler rkotler at mips.com
Tue Nov 26 12:38:40 PST 2013


Author: rkotler
Date: Tue Nov 26 14:38:40 2013
New Revision: 195781

URL: http://llvm.org/viewvc/llvm-project?rev=195781&view=rev
Log:
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.


Modified:
    llvm/trunk/lib/Target/Mips/MipsAsmPrinter.h
    llvm/trunk/test/CodeGen/Mips/fpnotneeded.ll

Modified: llvm/trunk/lib/Target/Mips/MipsAsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsAsmPrinter.h?rev=195781&r1=195780&r2=195781&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsAsmPrinter.h (original)
+++ llvm/trunk/lib/Target/Mips/MipsAsmPrinter.h Tue Nov 26 14:38:40 2013
@@ -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!

Modified: llvm/trunk/test/CodeGen/Mips/fpnotneeded.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/fpnotneeded.ll?rev=195781&r1=195780&r2=195781&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/fpnotneeded.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/fpnotneeded.ll Tue Nov 26 14:38:40 2013
@@ -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" }
 
 





More information about the llvm-commits mailing list