blob: 39c213f00ab846efd3b463f9dd877a3d0a529217 [file] [log] [blame]
Eli Friedmand6e25602011-12-26 22:49:32 +00001; RUN: llc -march=x86-64 -mattr=-sse42,+sse41 < %s | FileCheck %s
2; Make sure we don't load from the location pointed to by %p
3; twice: it has non-obvious performance implications, and
4; the relevant transformation doesn't know how to update
5; the chains correctly.
6; PR10747
7
8; CHECK: test:
9; CHECK: pextrd $2, %xmm
10define <4 x i32> @test(<4 x i32>* %p) {
11 %v = load <4 x i32>* %p
12 %e = extractelement <4 x i32> %v, i32 2
13 %cmp = icmp eq i32 %e, 3
14 %sel = select i1 %cmp, <4 x i32> %v, <4 x i32> zeroinitializer
15 ret <4 x i32> %sel
16}