blob: a87b7d52771b1c9a694fce87f6541eb3d6542b1c [file] [log] [blame]
Ulrich Weigand9958c482015-05-05 19:34:10 +00001; Verify ReplaceExtractVectorEltOfLoadWithNarrowedLoad fixes
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
4
5; Test a case where a vector extraction can be simplified to a scalar load.
6; The index must be extended from i32 to i64.
7define i32 @f1(<4 x i32> *%ptr, i32 %index) {
8; CHECK-LABEL: f1:
Jonas Paulsson25e193d2016-06-30 07:13:56 +00009; CHECK: risbgn {{%r[0-5]}}, %r3, 30, 189, 2
Ulrich Weigand9958c482015-05-05 19:34:10 +000010; CHECK: l %r2,
11; CHECK: br %r14
12 %vec = load <4 x i32>, <4 x i32> *%ptr
13 %res = extractelement <4 x i32> %vec, i32 %index
14 ret i32 %res
15}