[clang] [llvm] LLVM] Add `__builtin_readfixedtimer` intrinsic and buiiltin for realtime clocks (PR #81331)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 19:11:01 PST 2024


================
@@ -312,6 +312,12 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
     CI->replaceAllUsesWith(ConstantInt::get(Type::getInt64Ty(Context), 0));
     break;
   }
+  case Intrinsic::readfixedtimer: {
+    errs() << "WARNING: this target does not support the llvm.readfixedtimer"
+           << " intrinsic.  It is being lowered to a constant 0\n";
+    CI->replaceAllUsesWith(ConstantInt::get(Type::getInt64Ty(Context), 0));
----------------
jhuber6 wrote:

I copied it from the other one, but either way works. I think setting it to zero is a little more explicit.

https://github.com/llvm/llvm-project/pull/81331


More information about the llvm-commits mailing list