summaryrefslogtreecommitdiff
path: root/test/Transforms/ConstantHoisting
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@apple.com>2014-04-10 01:36:59 +0000
committerJuergen Ributzka <juergen@apple.com>2014-04-10 01:36:59 +0000
commitd631cc45635a59c4169f30d19bd97d5f8b8480b6 (patch)
tree06507c1e697cbaa7d94bde503b41b47d2072621f /test/Transforms/ConstantHoisting
parent6a6b4d5dfab7ec2706dadf48a82b67c3a2079c3a (diff)
downloadllvm-d631cc45635a59c4169f30d19bd97d5f8b8480b6.tar.gz
llvm-d631cc45635a59c4169f30d19bd97d5f8b8480b6.tar.bz2
llvm-d631cc45635a59c4169f30d19bd97d5f8b8480b6.tar.xz
[ARM64] Fix immediate cost calculation for types larger than i64.
The immediate cost calculation code was hitting an assertion in the included test case, because APInt was still internally 128-bits. Truncating it to 64-bits fixed the issue. Fixes <rdar://problem/16572521>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ConstantHoisting')
-rw-r--r--test/Transforms/ConstantHoisting/ARM64/large-immediate.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/ConstantHoisting/ARM64/large-immediate.ll b/test/Transforms/ConstantHoisting/ARM64/large-immediate.ll
new file mode 100644
index 0000000000..0965a45ea6
--- /dev/null
+++ b/test/Transforms/ConstantHoisting/ARM64/large-immediate.ll
@@ -0,0 +1,10 @@
+; RUN: opt -mtriple=arm64-darwin-unknown -S -consthoist < %s | FileCheck %s
+
+define i128 @test1(i128 %a) nounwind {
+; CHECK-LABEL: test1
+; CHECK: %const = bitcast i128 12297829382473034410122878 to i128
+ %1 = add i128 %a, 12297829382473034410122878
+ %2 = add i128 %1, 12297829382473034410122878
+ ret i128 %2
+}
+