]> granicus.if.org Git - llvm/commitdiff
AMDGPU: Ignore CodeObjectV3 when inlining
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 12 Feb 2019 23:30:11 +0000 (23:30 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 12 Feb 2019 23:30:11 +0000 (23:30 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353899 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
test/Transforms/Inline/AMDGPU/inline-target-cpu.ll

index 5965072f81eae96ec3d10fa2c594aa04bf14f96f..e5840062cb81ab1c58373c9e8669b509f78113af 100644 (file)
@@ -84,6 +84,7 @@ class GCNTTIImpl final : public BasicTTIImplBase<GCNTTIImpl> {
     AMDGPU::FeatureSGPRInitBug,
     AMDGPU::FeatureXNACK,
     AMDGPU::FeatureTrapHandler,
+    AMDGPU::FeatureCodeObjectV3,
 
     // Perf-tuning features
     AMDGPU::FeatureFastFMAF32,
index 4258fc5bc828ff0501b104d3b7b5de0cafdc12b0..87330c72d442c03e381fcf41de43d21ed01c4753 100644 (file)
@@ -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" }