42 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost < %s | FileCheck %s3 4@global1 = global i32 1, align 45@global2 = global i32 2, align 46 7; This test looks at the globals in the regions, and if it they are the8; same it outlines the region without elevating the globals to arguments.9 10define void @outline_globals1() {11; CHECK-LABEL: @outline_globals1(12; CHECK-NEXT: entry:13; CHECK-NEXT: call void @outlined_ir_func_0()14; CHECK-NEXT: ret void15;16entry:17 %0 = load i32, ptr @global118 %1 = load i32, ptr @global219 %2 = add i32 %0, %120 ret void21}22 23define void @outline_globals2() {24; CHECK-LABEL: @outline_globals2(25; CHECK-NEXT: entry:26; CHECK-NEXT: call void @outlined_ir_func_0()27; CHECK-NEXT: ret void28;29entry:30 %0 = load i32, ptr @global131 %1 = load i32, ptr @global232 %2 = add i32 %0, %133 ret void34}35 36; CHECK: define internal void @outlined_ir_func_0()37; CHECK: entry_to_outline:38; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr @global1, align 439; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr @global2, align 440; CHECK-NEXT: [[ADD:%.*]] = add i32 [[TMP1]], [[TMP2]]41 42