summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-06-10 00:32:29 +0000
committerJuergen Ributzka <juergen@apple.com>2014-06-10 00:32:29 +0000
commit8b9e31c6e274d71ec91e3a2c88851de8675a43fd (patch)
tree9e0da99cee6c464860dda1bafc12fe73cf634581 /test/Transforms
parent9de6eef6d033a187ec887cff42e742add92eca6e (diff)
downloadllvm-8b9e31c6e274d71ec91e3a2c88851de8675a43fd.tar.gz
llvm-8b9e31c6e274d71ec91e3a2c88851de8675a43fd.tar.bz2
llvm-8b9e31c6e274d71ec91e3a2c88851de8675a43fd.tar.xz
[ConstantHoisting][X86] Improve the cost model for small constants with large types (i64 and above).
This improves the X86 cost model for small constants with large types. Before this commit we would even hoist trivial constants such as i96 2. This is related to <rdar://problem/17070936> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/ConstantHoisting/X86/large-immediate.ll9
-rw-r--r--test/Transforms/ConstantHoisting/X86/stackmap.ll6
2 files changed, 12 insertions, 3 deletions
diff --git a/test/Transforms/ConstantHoisting/X86/large-immediate.ll b/test/Transforms/ConstantHoisting/X86/large-immediate.ll
index e0af9c9be5..b8c04f38b1 100644
--- a/test/Transforms/ConstantHoisting/X86/large-immediate.ll
+++ b/test/Transforms/ConstantHoisting/X86/large-immediate.ll
@@ -25,3 +25,12 @@ define i196 @test3(i196 %a) nounwind {
%2 = mul i196 %1, 2
ret i196 %2
}
+
+; Check that we don't hoist immediates with small values.
+define i96 @test4(i96 %a) nounwind {
+; CHECK-LABEL: test4
+; CHECK-NOT: %const = bitcast i96 2 to i96
+ %1 = mul i96 %a, 2
+ %2 = add i96 %1, 2
+ ret i96 %2
+}
diff --git a/test/Transforms/ConstantHoisting/X86/stackmap.ll b/test/Transforms/ConstantHoisting/X86/stackmap.ll
index cef022ebc0..9df4417782 100644
--- a/test/Transforms/ConstantHoisting/X86/stackmap.ll
+++ b/test/Transforms/ConstantHoisting/X86/stackmap.ll
@@ -6,11 +6,11 @@ target triple = "x86_64-apple-macosx10.9.0"
; Test if the 3rd argument of a stackmap is hoisted.
define i128 @test1(i128 %a) {
; CHECK-LABEL: @test1
-; CHECK: %const = bitcast i128 13464618275673403322 to i128
+; CHECK: %const = bitcast i128 134646182756734033220 to i128
; CHECK: tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 24, i128 %const)
entry:
- %0 = add i128 %a, 13464618275673403322
- tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 24, i128 13464618275673403322)
+ %0 = add i128 %a, 134646182756734033220
+ tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 24, i128 134646182756734033220)
ret i128 %0
}