xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/fast-isel-remat-same-constant.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc %s -o - -fast-isel=true -O0 -verify-machineinstrs | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
4*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7-apple-ios8.0.0"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; This test failed with verify machine instrs due to incorrect kill flags on the add instructions
7*9880d681SAndroid Build Coastguard Worker; generated by the GEPs.  The first add generated killed the vreg for the #6680 constant which should
8*9880d681SAndroid Build Coastguard Worker; be correct.  However, the second add is also a constant expression and the local value save area grows
9*9880d681SAndroid Build Coastguard Worker; down.  This meant the next use of the vreg for #6680 was after the first which had killed it.
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; CHECK: #6680
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker%struct.RD_8x8DATA = type { i32, [16 x [16 x i32]], [16 x [16 x i32]], [16 x [16 x i32]], [3 x [16 x [16 x i32]]], [4 x i16], [4 x i8], [4 x i8], [4 x i8], [16 x [16 x i16]], [16 x [16 x i16]], [16 x [16 x i32]] }
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker@tr8x8 = external global %struct.RD_8x8DATA, align 4
16*9880d681SAndroid Build Coastguard Worker@tr4x4 = external global %struct.RD_8x8DATA, align 4
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Worker; Function Attrs: noreturn
19*9880d681SAndroid Build Coastguard Workerdeclare void @foo(i16*, i16*) #0
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker; Function Attrs: minsize
22*9880d681SAndroid Build Coastguard Workerdefine i32 @test() #1 {
23*9880d681SAndroid Build Coastguard Workerbb:
24*9880d681SAndroid Build Coastguard Worker  call void @foo(i16* getelementptr inbounds (%struct.RD_8x8DATA, %struct.RD_8x8DATA* @tr8x8, i32 0, i32 10, i32 0, i32 0), i16* getelementptr inbounds (%struct.RD_8x8DATA, %struct.RD_8x8DATA* @tr4x4, i32 0, i32 10, i32 0, i32 0))
25*9880d681SAndroid Build Coastguard Worker  unreachable
26*9880d681SAndroid Build Coastguard Worker}
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerattributes #0 = { noreturn }
29*9880d681SAndroid Build Coastguard Workerattributes #1 = { minsize }
30