xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/selectiondag-optlevel.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips -fast-isel=false -O0 < %s 2>&1 | FileCheck %s -check-prefix=O0
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips -fast-isel=false -O2 < %s 2>&1 | FileCheck %s -check-prefix=O2
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; At -O0, DAGCombine won't try to merge these consecutive loads but it will at
5*9880d681SAndroid Build Coastguard Worker; -O2.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine void @foo() nounwind {
8*9880d681SAndroid Build Coastguard Workerentry:
9*9880d681SAndroid Build Coastguard Worker  %0 = alloca [2 x i8], align 32
10*9880d681SAndroid Build Coastguard Worker  %1 = getelementptr inbounds [2 x i8], [2 x i8]* %0, i32 0, i32 0
11*9880d681SAndroid Build Coastguard Worker  store i8 1, i8* %1
12*9880d681SAndroid Build Coastguard Worker  %2 = getelementptr inbounds [2 x i8], [2 x i8]* %0, i32 0, i32 1
13*9880d681SAndroid Build Coastguard Worker  store i8 1, i8* %2
14*9880d681SAndroid Build Coastguard Worker  ret void
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker; O0: addiu $[[REG:[0-9]+]], $zero, 1
18*9880d681SAndroid Build Coastguard Worker; O0-DAG: sb $[[REG]], 0($sp)
19*9880d681SAndroid Build Coastguard Worker; O0-DAG: sb $[[REG]], 1($sp)
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker; O2: addiu $[[REG:[0-9]+]], $zero, 257
22*9880d681SAndroid Build Coastguard Worker; O2: sh $[[REG]], 0($sp)
23