[llvm] r174583 - Make sure we call externals from libraries properly when -static.

Reed Kotler rkotler at mips.com
Wed Feb 6 20:34:51 PST 2013


Author: rkotler
Date: Wed Feb  6 22:34:51 2013
New Revision: 174583

URL: http://llvm.org/viewvc/llvm-project?rev=174583&view=rev
Log:
Make sure we call externals from libraries properly when -static.
For example, when we are doing mips16 hard float or soft float.


Added:
    llvm/trunk/test/CodeGen/Mips/fp16static.ll
Modified:
    llvm/trunk/lib/Target/Mips/Mips16InstrInfo.td

Modified: llvm/trunk/lib/Target/Mips/Mips16InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/Mips16InstrInfo.td?rev=174583&r1=174582&r2=174583&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/Mips16InstrInfo.td (original)
+++ llvm/trunk/lib/Target/Mips/Mips16InstrInfo.td Wed Feb  6 22:34:51 2013
@@ -1094,6 +1094,9 @@ class UncondBranch16_pat<SDNode OpNode,
 def : Mips16Pat<(MipsJmpLink (i32 tglobaladdr:$dst)),
                 (Jal16 tglobaladdr:$dst)>;
 
+def : Mips16Pat<(MipsJmpLink (i32 texternalsym:$dst)),
+                (Jal16 texternalsym:$dst)>;
+
 // Indirect branch
 def: Mips16Pat<
   (brind CPU16Regs:$rs),

Added: llvm/trunk/test/CodeGen/Mips/fp16static.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/fp16static.ll?rev=174583&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/fp16static.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/fp16static.ll Wed Feb  6 22:34:51 2013
@@ -0,0 +1,13 @@
+; RUN: llc -march=mipsel -mcpu=mips16 -mips16-hard-float -soft-float -relocation-model=static < %s | FileCheck %s -check-prefix=CHECK-STATIC16
+
+ at x = common global float 0.000000e+00, align 4
+
+define void @foo() nounwind {
+entry:
+  %0 = load float* @x, align 4
+  %1 = load float* @x, align 4
+  %mul = fmul float %0, %1
+  store float %mul, float* @x, align 4
+; CHECK-STATIC16: jal	__mips16_mulsf3
+  ret void
+}





More information about the llvm-commits mailing list