xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/indexed-load.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; The SplitIndexingFromLoad tranformation exposed an isel backend bug.  This
4*9880d681SAndroid Build Coastguard Worker; testcase used to generate stwx 4, 3, 64.  stwx does not have an
5*9880d681SAndroid Build Coastguard Worker; immediate-offset format (note the 64) and it should not be matched.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-i64:64-n32:64"
8*9880d681SAndroid Build Coastguard Workertarget triple = "powerpc64le-unknown-linux-gnu"
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker%class.test = type { [64 x i8], [5 x i8] }
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f:
13*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: stwx {{[0-9]+}}, {{[0-9]+}}, 64
14*9880d681SAndroid Build Coastguard Workerdefine void @f(%class.test* %this) {
15*9880d681SAndroid Build Coastguard Workerentry:
16*9880d681SAndroid Build Coastguard Worker  %Subminor.i.i = getelementptr inbounds %class.test, %class.test* %this, i64 0, i32 1
17*9880d681SAndroid Build Coastguard Worker  %0 = bitcast [5 x i8]* %Subminor.i.i to i40*
18*9880d681SAndroid Build Coastguard Worker  %bf.load2.i.i = load i40, i40* %0, align 4
19*9880d681SAndroid Build Coastguard Worker  %bf.clear7.i.i = and i40 %bf.load2.i.i, -8589934592
20*9880d681SAndroid Build Coastguard Worker  store i40 %bf.clear7.i.i, i40* %0, align 4
21*9880d681SAndroid Build Coastguard Worker  ret void
22*9880d681SAndroid Build Coastguard Worker}
23