diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-09 19:05:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-09 19:05:49 +0000 |
commit | 47cf3459db560a515efe288bb917685a80405315 (patch) | |
tree | 37574ddaf2cf61216e33a11e16ab6aacf448d986 /test | |
parent | 515072f769a637565fdcedb435899d8ce018b0ee (diff) | |
download | external_llvm-47cf3459db560a515efe288bb917685a80405315.zip external_llvm-47cf3459db560a515efe288bb917685a80405315.tar.gz external_llvm-47cf3459db560a515efe288bb917685a80405315.tar.bz2 |
when we see a unaligned load from an insufficiently aligned global or
alloca, increase the alignment of the load, turning it into an aligned load.
This allows us to compile:
#include <xmmintrin.h>
__m128i foo(__m128i x){
static const unsigned int c_0[4] = { 0, 0, 0, 0 };
__m128i v_Zero = _mm_loadu_si128((__m128i*)c_0);
x = _mm_unpacklo_epi8(x, v_Zero);
return x;
}
into:
_foo:
punpcklbw _c_0.5944, %xmm0
ret
.data
.lcomm _c_0.5944,16,4 # c_0.5944
instead of:
_foo:
movdqu _c_0.5944, %xmm1
punpcklbw %xmm1, %xmm0
ret
.data
.lcomm _c_0.5944,16,2 # c_0.5944
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/align-inc.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/align-inc.ll b/test/Transforms/InstCombine/align-inc.ll new file mode 100644 index 0000000..89388dd --- /dev/null +++ b/test/Transforms/InstCombine/align-inc.ll @@ -0,0 +1,14 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {GLOBAL.*align 16} +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {tmp = load} + +@GLOBAL = internal constant [4 x i32] zeroinitializer + +declare <16 x i8> @llvm.x86.sse2.loadu.dq(i8*) + + +define <16 x i8> @foo(<2 x i64> %x) { +entry: + %tmp = tail call <16 x i8> @llvm.x86.sse2.loadu.dq( i8* bitcast ([4 x i32]* @GLOBAL to i8*) ) + ret <16 x i8> %tmp +} + |