From f75a7d3fbf7fbb3071f45e248d3fb93312ec4fbd Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 28 May 2010 01:14:11 +0000 Subject: Eliminate the restriction that the array size in an alloca must be i32. This will help reduce the amount of casting required on 64-bit targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104911 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/alloca-align-rounding-32.ll | 15 +++++++++++++++ test/CodeGen/X86/alloca-align-rounding.ll | 9 ++++----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 test/CodeGen/X86/alloca-align-rounding-32.ll (limited to 'test') diff --git a/test/CodeGen/X86/alloca-align-rounding-32.ll b/test/CodeGen/X86/alloca-align-rounding-32.ll new file mode 100644 index 0000000000..c0f1a18123 --- /dev/null +++ b/test/CodeGen/X86/alloca-align-rounding-32.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin | grep and | count 1 + +declare void @bar(<2 x i64>* %n) + +define void @foo(i32 %h) { + %p = alloca <2 x i64>, i32 %h + call void @bar(<2 x i64>* %p) + ret void +} + +define void @foo2(i32 %h) { + %p = alloca <2 x i64>, i32 %h, align 32 + call void @bar(<2 x i64>* %p) + ret void +} diff --git a/test/CodeGen/X86/alloca-align-rounding.ll b/test/CodeGen/X86/alloca-align-rounding.ll index f45e9b84b2..3c87dbf2bd 100644 --- a/test/CodeGen/X86/alloca-align-rounding.ll +++ b/test/CodeGen/X86/alloca-align-rounding.ll @@ -1,16 +1,15 @@ -; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin | grep and | count 1 ; RUN: llc < %s -march=x86-64 -mtriple=i686-pc-linux | grep and | count 1 declare void @bar(<2 x i64>* %n) -define void @foo(i32 %h) { - %p = alloca <2 x i64>, i32 %h +define void @foo(i64 %h) { + %p = alloca <2 x i64>, i64 %h call void @bar(<2 x i64>* %p) ret void } -define void @foo2(i32 %h) { - %p = alloca <2 x i64>, i32 %h, align 32 +define void @foo2(i64 %h) { + %p = alloca <2 x i64>, i64 %h, align 32 call void @bar(<2 x i64>* %p) ret void } -- cgit v1.2.3