You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.205
Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
This commit is contained in:
parent
5cd5df71cc
commit
8e12397d70
113
external/llvm/test/Transforms/Inline/ARM/inline-fp.ll
vendored
Normal file
113
external/llvm/test/Transforms/Inline/ARM/inline-fp.ll
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
; RUN: opt -S -inline -mtriple=arm-eabi -pass-remarks=.* -pass-remarks-missed=.* < %s 2>&1 | FileCheck %s -check-prefix=NOFP
|
||||
; RUN: opt -S -inline -mtriple=arm-eabi -mattr=+vfp2 -pass-remarks=.* -pass-remarks-missed=.* < %s 2>&1 | FileCheck %s -check-prefix=FULLFP
|
||||
; RUN: opt -S -inline -mtriple=arm-eabi -mattr=+vfp2,+fp-only-sp -pass-remarks=.* -pass-remarks-missed=.* < %s 2>&1 | FileCheck %s -check-prefix=SINGLEFP
|
||||
; Make sure that soft float implementations are calculated as being more expensive
|
||||
; to the inliner.
|
||||
|
||||
; NOFP-DAG: single not inlined into test_single because too costly to inline (cost=125, threshold=75)
|
||||
; NOFP-DAG: single not inlined into test_single because too costly to inline (cost=125, threshold=75)
|
||||
; NOFP-DAG: single_cheap inlined into test_single_cheap with cost=-15 (threshold=75)
|
||||
; NOFP-DAG: single_cheap inlined into test_single_cheap with cost=-15015 (threshold=75)
|
||||
; NOFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75)
|
||||
; NOFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75)
|
||||
; NOFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75)
|
||||
; NOFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75)
|
||||
|
||||
; FULLFP-DAG: single inlined into test_single with cost=0 (threshold=75)
|
||||
; FULLFP-DAG: single inlined into test_single with cost=-15000 (threshold=75)
|
||||
; FULLFP-DAG: single_cheap inlined into test_single_cheap with cost=-15 (threshold=75)
|
||||
; FULLFP-DAG: single_cheap inlined into test_single_cheap with cost=-15015 (threshold=75)
|
||||
; FULLFP-DAG: double inlined into test_double with cost=0 (threshold=75)
|
||||
; FULLFP-DAG: double inlined into test_double with cost=-15000 (threshold=75)
|
||||
; FULLFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75)
|
||||
; FULLFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75)
|
||||
|
||||
; SINGLEFP-DAG: single inlined into test_single with cost=0 (threshold=75)
|
||||
; SINGLEFP-DAG: single inlined into test_single with cost=-15000 (threshold=75)
|
||||
; SINGLEFP-DAG: single_cheap inlined into test_single_cheap with cost=-15 (threshold=75)
|
||||
; SINGLEFP-DAG: single_cheap inlined into test_single_cheap with cost=-15015 (threshold=75)
|
||||
; SINGLEFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75)
|
||||
; SINGLEFP-DAG: double not inlined into test_double because too costly to inline (cost=125, threshold=75)
|
||||
; SINGLEFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75)
|
||||
; SINGLEFP-DAG: single_force_soft not inlined into test_single_force_soft because too costly to inline (cost=125, threshold=75)
|
||||
|
||||
define i32 @test_single(i32 %a, i8 %b, i32 %c, i8 %d) #0 {
|
||||
%call = call float @single(i32 %a, i8 zeroext %b)
|
||||
%call2 = call float @single(i32 %c, i8 zeroext %d)
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @test_single_cheap(i32 %a, i8 %b, i32 %c, i8 %d) #0 {
|
||||
%call = call float @single_cheap(i32 %a, i8 zeroext %b)
|
||||
%call2 = call float @single_cheap(i32 %c, i8 zeroext %d)
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @test_double(i32 %a, i8 %b, i32 %c, i8 %d) #0 {
|
||||
%call = call double @double(i32 %a, i8 zeroext %b)
|
||||
%call2 = call double @double(i32 %c, i8 zeroext %d)
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define i32 @test_single_force_soft(i32 %a, i8 %b, i32 %c, i8 %d) #1 {
|
||||
%call = call float @single_force_soft(i32 %a, i8 zeroext %b) #1
|
||||
%call2 = call float @single_force_soft(i32 %c, i8 zeroext %d) #1
|
||||
ret i32 0
|
||||
}
|
||||
|
||||
define internal float @single(i32 %response, i8 zeroext %value1) #0 {
|
||||
entry:
|
||||
%conv = zext i8 %value1 to i32
|
||||
%sub = add nsw i32 %conv, -1
|
||||
%conv1 = sitofp i32 %sub to float
|
||||
%0 = tail call float @llvm.pow.f32(float 0x3FF028F5C0000000, float %conv1)
|
||||
%mul = fmul float %0, 2.620000e+03
|
||||
%conv2 = sitofp i32 %response to float
|
||||
%sub3 = fsub float %conv2, %mul
|
||||
%div = fdiv float %sub3, %mul
|
||||
ret float %div
|
||||
}
|
||||
|
||||
define internal float @single_cheap(i32 %response, i8 zeroext %value1) #0 {
|
||||
entry:
|
||||
%conv = zext i8 %value1 to i32
|
||||
%sub = add nsw i32 %conv, -1
|
||||
%conv1 = bitcast i32 %sub to float
|
||||
%conv2 = bitcast i32 %response to float
|
||||
%0 = tail call float @llvm.pow.f32(float %conv2, float %conv1)
|
||||
%1 = tail call float @llvm.pow.f32(float %0, float %0)
|
||||
%2 = tail call float @llvm.pow.f32(float %1, float %1)
|
||||
ret float %2
|
||||
}
|
||||
|
||||
define internal double @double(i32 %response, i8 zeroext %value1) #0 {
|
||||
entry:
|
||||
%conv = zext i8 %value1 to i32
|
||||
%sub = add nsw i32 %conv, -1
|
||||
%conv1 = sitofp i32 %sub to double
|
||||
%0 = tail call double @llvm.pow.f64(double 0x3FF028F5C0000000, double %conv1)
|
||||
%mul = fmul double %0, 2.620000e+03
|
||||
%conv2 = sitofp i32 %response to double
|
||||
%sub3 = fsub double %conv2, %mul
|
||||
%div = fdiv double %sub3, %mul
|
||||
ret double %div
|
||||
}
|
||||
|
||||
define internal float @single_force_soft(i32 %response, i8 zeroext %value1) #1 {
|
||||
entry:
|
||||
%conv = zext i8 %value1 to i32
|
||||
%sub = add nsw i32 %conv, -1
|
||||
%conv1 = sitofp i32 %sub to float
|
||||
%0 = tail call float @llvm.pow.f32(float 0x3FF028F5C0000000, float %conv1)
|
||||
%mul = fmul float %0, 2.620000e+03
|
||||
%conv2 = sitofp i32 %response to float
|
||||
%sub3 = fsub float %conv2, %mul
|
||||
%div = fdiv float %sub3, %mul
|
||||
ret float %div
|
||||
}
|
||||
|
||||
declare float @llvm.pow.f32(float, float) optsize minsize
|
||||
declare double @llvm.pow.f64(double, double) optsize minsize
|
||||
|
||||
attributes #0 = { optsize }
|
||||
attributes #1 = { optsize "use-soft-float"="true" "target-features"="+soft-float" }
|
60
external/llvm/test/Transforms/Inline/ARM/inline-target-attr.ll
vendored
Normal file
60
external/llvm/test/Transforms/Inline/ARM/inline-target-attr.ll
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
; RUN: opt < %s -mtriple=arm-unknown-linux-gnu -S -inline | FileCheck %s
|
||||
; RUN: opt < %s -mtriple=arm-unknown-linux-gnu -S -passes='cgscc(inline)' | FileCheck %s
|
||||
; Check that we only inline when we have compatible target attributes.
|
||||
; ARM has implemented a target attribute that will verify that the attribute
|
||||
; sets are compatible.
|
||||
|
||||
define i32 @foo() #0 {
|
||||
entry:
|
||||
%call = call i32 (...) @baz()
|
||||
ret i32 %call
|
||||
; CHECK-LABEL: foo
|
||||
; CHECK: call i32 (...) @baz()
|
||||
}
|
||||
declare i32 @baz(...) #0
|
||||
|
||||
define i32 @bar() #1 {
|
||||
entry:
|
||||
%call = call i32 @foo()
|
||||
ret i32 %call
|
||||
; CHECK-LABEL: bar
|
||||
; CHECK: call i32 (...) @baz()
|
||||
}
|
||||
|
||||
define i32 @qux() #0 {
|
||||
entry:
|
||||
%call = call i32 @bar()
|
||||
ret i32 %call
|
||||
; CHECK-LABEL: qux
|
||||
; CHECK: call i32 @bar()
|
||||
}
|
||||
|
||||
define i32 @thumb_fn() #2 {
|
||||
entry:
|
||||
%call = call i32 @foo()
|
||||
ret i32 %call
|
||||
; CHECK-LABEL: thumb_fn
|
||||
; CHECK: call i32 @foo
|
||||
}
|
||||
|
||||
define i32 @strict_align() #3 {
|
||||
entry:
|
||||
%call = call i32 @foo()
|
||||
ret i32 %call
|
||||
; CHECK-LABEL: strict_align
|
||||
; CHECK: call i32 (...) @baz()
|
||||
}
|
||||
|
||||
define i32 @soft_float_fn() #4 {
|
||||
entry:
|
||||
%call = call i32 @foo()
|
||||
ret i32 %call
|
||||
; CHECK-LABEL: soft_float_fn
|
||||
; CHECK: call i32 @foo
|
||||
}
|
||||
|
||||
attributes #0 = { "target-cpu"="generic" "target-features"="+dsp,+neon" }
|
||||
attributes #1 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+fp16" }
|
||||
attributes #2 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+fp16,+thumb-mode" }
|
||||
attributes #3 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+strict-align" }
|
||||
attributes #4 = { "target-cpu"="generic" "target-features"="+dsp,+neon,+fp16,+soft-float" }
|
2
external/llvm/test/Transforms/Inline/ARM/lit.local.cfg
vendored
Normal file
2
external/llvm/test/Transforms/Inline/ARM/lit.local.cfg
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
if not 'ARM' in config.root.targets:
|
||||
config.unsupported = True
|
Reference in New Issue
Block a user