1 ; RUN: llc -mtriple=x86_64-apple-macosx10.9.0 -mcpu=core2 -mattr=+64bit,+sse2 < %s | FileCheck %s
3 ; DAGCombine may choose to rewrite 2 loads feeding a select as a select of
4 ; addresses feeding a load. This test ensures that when it does that it creates
5 ; a load with alignment equivalent to the most restrictive source load.
7 declare void @sink(<2 x double>)
9 define void @test1(i1 %cmp) align 2 {
10 %1 = alloca <2 x double>, align 16
11 %2 = alloca <2 x double>, align 8
13 %val = load <2 x double>, <2 x double>* %1, align 16
14 %val2 = load <2 x double>, <2 x double>* %2, align 8
15 %val3 = select i1 %cmp, <2 x double> %val, <2 x double> %val2
16 call void @sink(<2 x double> %val3)
23 define void @test2(i1 %cmp) align 2 {
24 %1 = alloca <2 x double>, align 16
25 %2 = alloca <2 x double>, align 8
27 %val = load <2 x double>, <2 x double>* %1, align 16
28 %val2 = load <2 x double>, <2 x double>* %2, align 16
29 %val3 = select i1 %cmp, <2 x double> %val, <2 x double> %val2
30 call void @sink(<2 x double> %val3)