1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;RUN: llc < %s -mtriple=i686 -mattr=sse4.1 -stop-after=finalize-isel 2>&1 | FileCheck %s
4 ; This test makes sure we discard pointer info when we combine a vector load
5 ; and a variable extractelement into a scalar load using an index. There's also
6 ; a test to ensure we don't discard it for the constant index case.
8 ; CHECK: name: const_index
9 ; CHECK: bb.0 (%ir-block.0):
10 ; CHECK: [[POINTER:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.0)
11 ; CHECK: [[LOAD:%[0-9]+]]:gr32 = MOV32rm killed [[POINTER]], 1, $noreg, 4, $noreg :: (load 4 from %ir.v + 4)
12 ; CHECK: $eax = COPY [[LOAD]]
14 define i32 @const_index(<8 x i32>* %v) {
15 %a = load <8 x i32>, <8 x i32>* %v
16 %b = extractelement <8 x i32> %a, i32 1
20 ; CHECK: name: variable_index
21 ; CHECK: bb.0 (%ir-block.0):
22 ; CHECK: [[INDEX:%[0-9]+]]:gr32_nosp = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.0)
23 ; CHECK: [[POINTER:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.1)
24 ; CHECK: [[LOAD:%[0-9]+]]:gr32 = MOV32rm killed [[POINTER]], 4, killed [[INDEX]], 0, $noreg :: (load 4)
25 ; CHECK: $eax = COPY [[LOAD]]
27 define i32 @variable_index(<8 x i32>* %v, i32 %i) {
28 %a = load <8 x i32>, <8 x i32>* %v
29 %b = extractelement <8 x i32> %a, i32 %i
33 ; CHECK: name: variable_index_with_addrspace
34 ; CHECK: bb.0 (%ir-block.0):
35 ; CHECK: [[INDEX:%[0-9]+]]:gr32_nosp = MOV32rm %fixed-stack.0, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.0)
36 ; CHECK: [[POINTER:%[0-9]+]]:gr32 = MOV32rm %fixed-stack.1, 1, $noreg, 0, $noreg :: (load 4 from %fixed-stack.1)
37 ; CHECK: [[LOAD:%[0-9]+]]:gr32 = MOV32rm killed [[POINTER]], 4, killed [[INDEX]], 0, $noreg :: (load 4, addrspace 1)
38 ; CHECK: $eax = COPY [[LOAD]]
40 define i32 @variable_index_with_addrspace(<8 x i32> addrspace(1)* %v, i32 %i) {
41 %a = load <8 x i32>, <8 x i32> addrspace(1)* %v
42 %b = extractelement <8 x i32> %a, i32 %i