[flang-commits] [flang] [flang][runtime] Implement SLEEP intrinsic (PR #79074)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Wed Jan 24 09:14:39 PST 2024


================
@@ -235,3 +236,12 @@ void fir::runtime::genSystemClock(fir::FirOpBuilder &builder,
   if (max)
     makeCall(getRuntimeFunc<mkRTKey(SystemClockCountMax)>(loc, builder), max);
 }
+
+void fir::runtime::genSleep(fir::FirOpBuilder &builder, mlir::Location loc,
+                            mlir::Value seconds) {
+  mlir::Type int64 = builder.getIntegerType(64);
+  seconds = builder.create<fir::ConvertOp>(loc, int64, seconds);
+  mlir::func::FuncOp func{
+      fir::runtime::getRuntimeFunc<mkRTKey(Sleep)>(loc, builder)};
+  builder.create<fir::CallOp>(loc, func, seconds);
+}
----------------
tblah wrote:

This change broke code formatting in CI so I reverted it

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


More information about the flang-commits mailing list