Compiler projects using llvm
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s
; PR2676

define float @foo(<4 x float> %p, i32 %t) {
; CHECK-LABEL: foo:
; CHECK:       # %bb.0:
; CHECK-NEXT:    # kill: def $edi killed $edi def $rdi
; CHECK-NEXT:    movaps %xmm0, -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    andl $3, %edi
; CHECK-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
; CHECK-NEXT:    retq
  %z = extractelement <4 x float> %p, i32 %t
  ret float %z
}
define <4 x float> @bar(<4 x float> %p, float %f, i32 %t) {
; CHECK-LABEL: bar:
; CHECK:       # %bb.0:
; CHECK-NEXT:    # kill: def $edi killed $edi def $rdi
; CHECK-NEXT:    movaps %xmm0, -{{[0-9]+}}(%rsp)
; CHECK-NEXT:    andl $3, %edi
; CHECK-NEXT:    movss %xmm1, -24(%rsp,%rdi,4)
; CHECK-NEXT:    movaps -{{[0-9]+}}(%rsp), %xmm0
; CHECK-NEXT:    retq
  %z = insertelement <4 x float> %p, float %f, i32 %t
  ret <4 x float> %z
}