From d631cc45635a59c4169f30d19bd97d5f8b8480b6 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Thu, 10 Apr 2014 01:36:59 +0000 Subject: [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 . git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205947 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/ConstantHoisting/ARM64/large-immediate.ll | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/Transforms/ConstantHoisting/ARM64/large-immediate.ll (limited to 'test/Transforms/ConstantHoisting') 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 +} + -- cgit v1.2.3