brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · a8c5ed1 Raw
68 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 "%s"3 4; This has two compatible regions.  We have attributes that should be transferred5; even if it is on only one of the regions.6 7; This includes the attributes no-jump-tables, profile-sample-accurate,8; speculative_load_hardening, and noimplicitfloat.  When instance of similarity9; has these attributes can we say that the outlined function can have these10; attributes since that is the more general case.11 12define void @outline_attrs1() #0 {13; CHECK-LABEL: @outline_attrs1(14; CHECK-NEXT:  entry:15; CHECK-NEXT:    [[A:%.*]] = alloca i32, align 416; CHECK-NEXT:    [[B:%.*]] = alloca i32, align 417; CHECK-NEXT:    [[C:%.*]] = alloca i32, align 418; CHECK-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])19; CHECK-NEXT:    ret void20;21entry:22  %a = alloca i32, align 423  %b = alloca i32, align 424  %c = alloca i32, align 425  store i32 2, ptr %a, align 426  store i32 3, ptr %b, align 427  store i32 4, ptr %c, align 428  %al = load i32, ptr %a29  %bl = load i32, ptr %b30  %cl = load i32, ptr %c31  ret void32}33 34define void @outline_attrs2() {35; CHECK-LABEL: @outline_attrs2(36; CHECK-NEXT:  entry:37; CHECK-NEXT:    [[A:%.*]] = alloca i32, align 438; CHECK-NEXT:    [[B:%.*]] = alloca i32, align 439; CHECK-NEXT:    [[C:%.*]] = alloca i32, align 440; CHECK-NEXT:    call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])41; CHECK-NEXT:    ret void42;43entry:44  %a = alloca i32, align 445  %b = alloca i32, align 446  %c = alloca i32, align 447  store i32 2, ptr %a, align 448  store i32 3, ptr %b, align 449  store i32 4, ptr %c, align 450  %al = load i32, ptr %a51  %bl = load i32, ptr %b52  %cl = load i32, ptr %c53  ret void54}55 56attributes #0 = { "no-jump-tables"="true" "profile-sample-accurate"="true" "speculative_load_hardening" "noimplicitfloat"="true" "use-sample-profile"="true"}57 58; CHECK: define internal void @outlined_ir_func_0(ptr [[ARG0:%.*]], ptr [[ARG1:%.*]], ptr [[ARG2:%.*]]) [[ATTR:#[0-9]+]] {59; CHECK: entry_to_outline:60; CHECK-NEXT:    store i32 2, ptr [[ARG0]], align 461; CHECK-NEXT:    store i32 3, ptr [[ARG1]], align 462; CHECK-NEXT:    store i32 4, ptr [[ARG2]], align 463; CHECK-NEXT:    [[AL:%.*]] = load i32, ptr [[ARG0]], align 464; CHECK-NEXT:    [[BL:%.*]] = load i32, ptr [[ARG1]], align 465; CHECK-NEXT:    [[CL:%.*]] = load i32, ptr [[ARG2]], align 466 67; CHECK: attributes [[ATTR]] = { minsize optsize "no-jump-tables"="true" "noimplicitfloat"="true" "profile-sample-accurate"="true" "speculative_load_hardening" "use-sample-profile"="true" }68