[flang-commits] [flang] [flang][runtime] Implement SLEEP intrinsic (PR #79074)
Kiran Chandramohan via flang-commits
flang-commits at lists.llvm.org
Mon Jan 22 22:55:42 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);
+}
----------------
kiranchandramohan wrote:
Nit: new line
https://github.com/llvm/llvm-project/pull/79074
More information about the flang-commits
mailing list