xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/constant-hoisting-optnone.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=generic | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; Verify that pass 'Constant Hoisting' is not run on optnone functions.
4*9880d681SAndroid Build Coastguard Worker; Without optnone, Pass 'Constant Hoisting' would firstly hoist
5*9880d681SAndroid Build Coastguard Worker; constant 0xBEEBEEBEC, and then rebase the other constant
6*9880d681SAndroid Build Coastguard Worker; (i.e. constant 0xBEEBEEBF4) with respect to the previous one.
7*9880d681SAndroid Build Coastguard Worker; With optnone, we check that constants are not coalesced.
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine i64 @constant_hoisting_optnone() #0 {
10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @constant_hoisting_optnone
11*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movabsq {{.*#+}} imm = 0xBEEBEEBF4
12*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: movabsq {{.*#+}} imm = 0xBEEBEEBEC
13*9880d681SAndroid Build Coastguard Worker; CHECK: ret
14*9880d681SAndroid Build Coastguard Workerentry:
15*9880d681SAndroid Build Coastguard Worker  %0 = load i64, i64* inttoptr (i64 51250129900 to i64*)
16*9880d681SAndroid Build Coastguard Worker  %1 = load i64, i64* inttoptr (i64 51250129908 to i64*)
17*9880d681SAndroid Build Coastguard Worker  %2 = add i64 %0, %1
18*9880d681SAndroid Build Coastguard Worker  ret i64 %2
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerattributes #0 = { optnone noinline }
22