[PATCH] D59717: AMDGPU: Ignore SRAM ECC feature when inlining

Konstantin Zhuravlyov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 14:09:00 PDT 2019


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

https://reviews.llvm.org/D59717

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
@@ -89,6 +89,17 @@
   ret i32 %call
 }
 
+define i32 @sram_ecc_on() #12 {
+  ret i32 1
+}
+
+; CHECK-LABEL: @sram_ecc_off_calls_sram_ecc_on(
+; CHECK-NEXT: ret i32 1
+define i32 @sram_ecc_off_calls_sram_ecc_on() #13 {
+  %call = call i32 @sram_ecc_on()
+  ret i32 %call
+}
+
 attributes #0 = { nounwind }
 attributes #1 = { nounwind "target-cpu"="fiji" }
 attributes #2 = { nounwind "target-cpu"="fiji" "target-features"="+fp32-denormals" }
@@ -101,3 +112,5 @@
 attributes #9 = { nounwind "target-features"="+load-store-opt" }
 attributes #10 = { nounwind "target-features"="+code-object-v3" }
 attributes #11 = { nounwind "target-features"="-code-object-v3" }
+attributes #12 = { nounwind "target-features"="+sram-ecc" }
+attributes #13 = { nounwind "target-features"="-sram-ecc" }
Index: lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
===================================================================
--- lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+++ lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
@@ -83,6 +83,7 @@
     AMDGPU::FeatureXNACK,
     AMDGPU::FeatureTrapHandler,
     AMDGPU::FeatureCodeObjectV3,
+    AMDGPU::FeatureSRAMECC,
 
     // Perf-tuning features
     AMDGPU::FeatureFastFMAF32,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59717.191948.patch
Type: text/x-patch
Size: 1444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190322/6c4e5ad4/attachment.bin>


More information about the llvm-commits mailing list