[flang-commits] [PATCH] D129584: Lower F08 bit-population count intrinsics

Kiran Chandramohan via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jul 13 14:35:37 PDT 2022


kiranchandramohan added a reviewer: vzakhari.
kiranchandramohan added a subscriber: vzakhari.
kiranchandramohan added inline comments.


================
Comment at: flang/lib/Lower/IntrinsicCall.cpp:3157
+  mlir::FunctionType funcTy = builder.getFunctionType({intTy}, {intTy});
+  mlir::Value result = genMathOp<mlir::math::CountLeadingZerosOp>(
+      builder, loc, "ctlz", funcTy, args);
----------------
The `genMathOp` function seems to switch between the libm version and the Math dialect Op version based on whether the setting of `mathRuntimeVersion` is `precise` or not. I believe the mathRuntimeVersion is for floating point intrinsics and probably not applicable for integer intrinsics. Adding @vzakhari for an opinion on this.


================
Comment at: flang/test/Lower/Intrinsics/leadz.f90:1
+! RUN: bbc -emit-fir %s -o - | FileCheck %s
+
----------------
Nit: Could you add the flang driver also for tests.


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

https://reviews.llvm.org/D129584



More information about the flang-commits mailing list