brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 82d1f7a Raw
45 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --include-generated-funcs --version 52; RUN: opt -passes="ipsccp<func-spec>" -funcspec-min-function-size=1       \3; RUN:                                 -funcspec-for-literal-constant=true \4; RUN:                                 -funcspec-min-codesize-savings=50   \5; RUN:                                 -funcspec-min-latency-savings=50    \6; RUN:                                 -funcspec-max-codesize-growth=1     \7; RUN:                                 -S < %s | FileCheck %s8 9; Verify that we are able to specialize a function successfully after analysis10; of other specializations that are found to not be profitable.11define void @test_specialize_after_failed_analysis(i32 %n) {12entry:13  %notspec0 = call i32 @add(i32 0, i32 %n)14  %notspec1 = call i32 @add(i32 1, i32 %n)15  %spec = call i32 @add(i32 1, i32 1)16  ret void17}18 19define i32 @add(i32 %x, i32 %y) {20entry:21  %res = add i32 %x, %y22  ret i32 %res23}24; CHECK-LABEL: define void @test_specialize_after_failed_analysis(25; CHECK-SAME: i32 [[N:%.*]]) {26; CHECK-NEXT:  [[ENTRY:.*:]]27; CHECK-NEXT:    [[NOTSPEC0:%.*]] = call i32 @add(i32 0, i32 [[N]])28; CHECK-NEXT:    [[NOTSPEC1:%.*]] = call i32 @add(i32 1, i32 [[N]])29; CHECK-NEXT:    [[SPEC:%.*]] = call i32 @add.specialized.1(i32 1, i32 1)30; CHECK-NEXT:    ret void31;32;33; CHECK-LABEL: define i32 @add(34; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {35; CHECK-NEXT:  [[ENTRY:.*:]]36; CHECK-NEXT:    [[RES:%.*]] = add i32 [[X]], [[Y]]37; CHECK-NEXT:    ret i32 [[RES]]38;39;40; CHECK-LABEL: define internal i32 @add.specialized.1(41; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {42; CHECK-NEXT:  [[ENTRY:.*:]]43; CHECK-NEXT:    ret i32 poison44;45