[PATCH] D58151: AMDGPU: Ignore CodeObjectV3 when inlining

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 12 15:18:02 PST 2019


arsenm created this revision.
arsenm added reviewers: rampitec, kzhuravl.
Herald added subscribers: eraman, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely.

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.


https://reviews.llvm.org/D58151

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


Index: test/Transforms/Inline/AMDGPU/inline-target-cpu.ll
===================================================================
--- test/Transforms/Inline/AMDGPU/inline-target-cpu.ll
+++ test/Transforms/Inline/AMDGPU/inline-target-cpu.ll
@@ -78,6 +78,17 @@
   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 #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" }
Index: lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
===================================================================
--- lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+++ lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
@@ -84,6 +84,7 @@
     AMDGPU::FeatureSGPRInitBug,
     AMDGPU::FeatureXNACK,
     AMDGPU::FeatureTrapHandler,
+    AMDGPU::FeatureCodeObjectV3,
 
     // Perf-tuning features
     AMDGPU::FeatureFastFMAF32,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58151.186552.patch
Type: text/x-patch
Size: 1494 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190212/8b8cc118/attachment-0001.bin>


More information about the llvm-commits mailing list