[TwoAddressInstructionPass] When looking for a 3 addr conversion after commuting...
[oota-llvm.git] / test / CodeGen / X86 / 2011-12-26-extractelement-duplicate-load.ll
1 ; RUN: llc -march=x86-64 -mattr=-sse4.2,+sse4.1 < %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-LABEL: test:
9 ; CHECK: pextrd $2, %xmm
10 define <4 x i32> @test(<4 x i32>* %p) {
11   %v = load <4 x i32>, <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 }