[PATCH] D130096: [Clang][AMDGPU] Emit AMDGPU library control constants in clang

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 15:41:27 PDT 2022


arsenm added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9449-9450
+      !(Features & llvm::AMDGPU::FEATURE_WAVE32) ||
+      llvm::is_contained(CGM.getTarget().getTargetOpts().FeaturesAsWritten,
+                         "+wavefrontsize64");
+
----------------
Do we really have to scan through the features too? This seems broken


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9455
+  bool UnsafeMath = CGM.getLangOpts().UnsafeFPMath;
+  bool DenormAtZero = CGM.getCodeGenOpts().FP32DenormalMode ==
+                      llvm::DenormalMode::getPreserveSign();
----------------
s/DenormAtZero/DenormAreZero/?


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9458
+  bool FiniteOnly =
+      CGM.getLangOpts().NoHonorInfs || CGM.getLangOpts().NoHonorNaNs;
+
----------------
or doesn't look right. finite only is no infinities and no nans (not sure why the library control merges the two)


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9473-9475
+  AddGlobal("__oclc_ISA_version", Minor + Major * 1000, /*Size=*/32);
+  AddGlobal("__oclc_ABI_version",
+            CGM.getTarget().getTargetOpts().CodeObjectVersion, /*Size=*/32);
----------------
These probably should use linkonce_odr


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130096/new/

https://reviews.llvm.org/D130096



More information about the cfe-commits mailing list