[PATCH] D19283: AMDGPU/SI: Add support for AMD code object version 2.

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 14:40:45 PDT 2016


arsenm added inline comments.

================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:107-111
@@ -106,3 +106,7 @@
 
-  TS->EmitDirectiveHSACodeObjectVersion(1, 0);
+  if (STI->getTargetTriple().getEnvironment() == Triple::AMDCOV1)
+    TS->EmitDirectiveHSACodeObjectVersion(1, 0);
+  else
+    TS->EmitDirectiveHSACodeObjectVersion(2, 0);
+
   AMDGPU::IsaVersion ISA = AMDGPU::getIsaVersion(STI->getFeatureBits());
----------------
This looks like it should be a select on the value to pass to the function

================
Comment at: lib/Target/AMDGPU/AMDGPUSubtarget.h:328-329
@@ +327,4 @@
+  bool isAMDCodeObjectV2() const {
+    return (isAmdHsaOS() && !isAMDCodeObjectV1()) ||
+           TargetTriple.getEnvironment() == Triple::AMDCOV2;
+  }
----------------
Why are the extra checks needed here?


http://reviews.llvm.org/D19283





More information about the llvm-commits mailing list