[compiler-rt] [XRay][SystemZ] Use stckf for non-clang compilers (PR #125289)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 1 01:00:07 PST 2025
================
@@ -96,7 +96,13 @@ namespace __xray {
inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT { return true; }
ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+#if defined(__clang__)
return __builtin_readcyclecounter();
+#else
+ uint64_t Cycles;
+ asm volatile("stckf %0" : /* No output. */ : "Q"(Cycles) : "cc");
----------------
MaskRay wrote:
remove the unnecessary comment `/* No output. */`. In the majority of places we assume that the user is aware of the `: : ` syntax
https://github.com/llvm/llvm-project/pull/125289
More information about the llvm-commits
mailing list