Home | History | Annotate | Download | only in X86
      1 ; RUN: llc  -mtriple=x86_64-apple-macosx10.9.0  -mcpu=core2 -mattr=+64bit,+sse2 < %s | FileCheck %s
      2 
      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.
      6 
      7 declare void @sink(<2 x double>)
      8 
      9 define void @test1(i1 %cmp) align 2 {
     10   %1 = alloca  <2 x double>, align 16
     11   %2 = alloca  <2 x double>, align 8
     12 
     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)
     17   ret void
     18   ; CHECK: test1
     19   ; CHECK: movups
     20   ; CHECK: ret
     21 }
     22 
     23 define void @test2(i1 %cmp) align 2 {
     24   %1 = alloca  <2 x double>, align 16
     25   %2 = alloca  <2 x double>, align 8
     26 
     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)
     31   ret void
     32   ; CHECK: test2
     33   ; CHECK: movaps
     34   ; CHECK: ret
     35 }
     36