summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-11-05 08:14:14 +0000
committerReed Kotler <rkotler@mips.com>2013-11-05 08:14:14 +0000
commitc0e9800d45a2a08c95005385352a0ec9d6271498 (patch)
tree73d8148e0e064ebe625108ef002f1142391e747f /test
parentddfc20dea4dbd3e9fea354696f8ed50d4f01eef8 (diff)
downloadllvm-c0e9800d45a2a08c95005385352a0ec9d6271498.tar.gz
llvm-c0e9800d45a2a08c95005385352a0ec9d6271498.tar.bz2
llvm-c0e9800d45a2a08c95005385352a0ec9d6271498.tar.xz
Fix r194019 as requested by Eric Christopher.
Submit the basic port of the rest of ARM constant islands code to Mips. Two test cases are added which reflect the next level of functionality: constants getting moved to water areas that are out of range from the initial placement at the end of the function and basic blocks being split to create water when none exists that can be used. There is a bunch of this code that is not complete and has been marked with IN_PROGRESS. I will finish cleaning this all up during the next week or two and submit the rest of the test cases. I have elminated some code for dealing with inline assembly because to me it unecessarily complicates things and some of the newer features of llvm like function attributies and builtin assembler give me better tools to solve the alignment issues created there. Also, for Mips16 I even have the option of not doing constant islands in the present of inline assembler if I chose. When everything has been completed I will summarize the port and notify people that are knowledgable regarding the ARM Constant Islands code so they can review it in it's entirety if they wish. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/Mips/const4.ll64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/const4.ll b/test/CodeGen/Mips/const4.ll
new file mode 100644
index 0000000000..04da731859
--- /dev/null
+++ b/test/CodeGen/Mips/const4.ll
@@ -0,0 +1,64 @@
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static -mips16-constant-islands -mips-constant-islands-small-offset=20 < %s | FileCheck %s -check-prefix=offset20
+
+; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips16 -soft-float -mips16-hard-float -relocation-model=static -mips16-constant-islands -mips-constant-islands-small-offset=40 < %s | FileCheck %s -check-prefix=offset40
+
+
+@i = common global i32 0, align 4
+@b = common global i32 0, align 4
+
+; Function Attrs: nounwind
+define void @t() #0 {
+entry:
+ store i32 -559023410, i32* @i, align 4
+ %0 = load i32* @b, align 4
+ %tobool = icmp ne i32 %0, 0
+ br i1 %tobool, label %if.then, label %if.else
+; offset20: lw ${{[0-9]+}}, $CPI0_1 # 16 bit inst
+; offset20: b $BB0_2
+; offset20: .align 2
+; offset20: $CPI0_0:
+; offset20: .4byte 3735943886
+; offset20: $BB0_2:
+
+; offset40: beqz ${{[0-9]+}}, $BB0_3
+; offset40: jal foo
+; offset40: nop
+; offset40: b $BB0_4
+; offset40: .align 2
+; offset40: $CPI0_0:
+; offset40: .4byte 3735943886
+; offset40: $BB0_3:
+; offset40: jal goo
+
+if.then: ; preds = %entry
+ call void bitcast (void (...)* @foo to void ()*)()
+ br label %if.end
+
+if.else: ; preds = %entry
+ call void bitcast (void (...)* @goo to void ()*)()
+ br label %if.end
+
+if.end: ; preds = %if.else, %if.then
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ call void bitcast (void (...)* @hoo to void ()*)()
+ ret void
+}
+
+declare void @foo(...) #1
+
+declare void @goo(...) #1
+
+declare void @hoo(...) #1
+
+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" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
+attributes #1 = { "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" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="true" }
+
+!llvm.ident = !{!0}
+
+!0 = metadata !{metadata !"clang version 3.4 (gitosis@dmz-portal.mips.com:clang.git 3a50d847e098f36e3bf8bc14eea07a6cc35f7803) (gitosis@dmz-portal.mips.com:llvm.git f52db0b69f0c888bdc98bb2f13aaecc1e83288a9)"}