diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-02-12 23:30:11 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-02-12 23:30:11 +0000 |
commit | d24296e282bffe2702f5a795bb4f9ef4f581cb69 (patch) | |
tree | 5b0e2148b0cd7cd501d8b716ce1eb1db1d93d339 | |
parent | 749dc51e452d1eaed82b0418c9acc54c3e5e5bbf (diff) | |
download | bcm5719-llvm-d24296e282bffe2702f5a795bb4f9ef4f581cb69.tar.gz bcm5719-llvm-d24296e282bffe2702f5a795bb4f9ef4f581cb69.zip |
AMDGPU: Ignore CodeObjectV3 when inlining
This was inhibiting inlining of library functions when clang was
invoking the inliner directly. This is covering a bit of a mess with
subtarget feature handling, and this shouldn't be a subtarget
feature. The behavior is different depending on whether you are using
a -mattr flag in clang, or llc, opt.
llvm-svn: 353899
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h | 1 | ||||
-rw-r--r-- | llvm/test/Transforms/Inline/AMDGPU/inline-target-cpu.ll | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h index 5965072f81e..e5840062cb8 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h @@ -84,6 +84,7 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> { AMDGPU::FeatureSGPRInitBug, AMDGPU::FeatureXNACK, AMDGPU::FeatureTrapHandler, + AMDGPU::FeatureCodeObjectV3, // Perf-tuning features AMDGPU::FeatureFastFMAF32, diff --git a/llvm/test/Transforms/Inline/AMDGPU/inline-target-cpu.ll b/llvm/test/Transforms/Inline/AMDGPU/inline-target-cpu.ll index 4258fc5bc82..87330c72d44 100644 --- a/llvm/test/Transforms/Inline/AMDGPU/inline-target-cpu.ll +++ b/llvm/test/Transforms/Inline/AMDGPU/inline-target-cpu.ll @@ -78,6 +78,17 @@ define i32 @call_func_without_loadstoreopt() #9 { ret i32 %call } +define i32 @enable_codeobjectv3() #10 { + ret i32 999 +} + +; CHECK-LABEL: @disable_codeobjectv3_call_codeobjectv3( +; CHECK-NEXT: ret i32 999 +define i32 @disable_codeobjectv3_call_codeobjectv3() #11 { + %call = call i32 @enable_codeobjectv3() + ret i32 %call +} + attributes #0 = { nounwind } attributes #1 = { nounwind "target-cpu"="fiji" } attributes #2 = { nounwind "target-cpu"="fiji" "target-features"="+fp32-denormals" } @@ -88,3 +99,5 @@ attributes #6 = { nounwind "target-features"="-half-rate-64-ops" } attributes #7 = { nounwind "target-features"="+half-rate-64-ops" } attributes #8 = { nounwind "target-features"="-load-store-opt" } attributes #9 = { nounwind "target-features"="+load-store-opt" } +attributes #10 = { nounwind "target-features"="+code-object-v3" } +attributes #11 = { nounwind "target-features"="-code-object-v3" } |