[PATCH] D71989: [OpenMP][IRBuilder] `omp task` support

Shraiysh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 13 11:29:58 PDT 2022


shraiysh added inline comments.


================
Comment at: llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp:1369
+        FunctionType::get(Builder.getInt32Ty(), WrapperArgTys, false));
+    Function *WrapperFunc = dyn_cast<Function>(WrapperFuncVal.getCallee());
+    PointerType *WrapperFuncBitcastType =
----------------
mikerice wrote:
> The return value of this dyn_cast is not checked. Should this use cast instead (to satisfy static verifiers)? Or do you expect a nullptr return here? 
I do not expect it to return a nullptr in most cases. There could be a few corner cases that I am not aware of where it might.

I think we can change it to cast instead of dyn_cast, or if that doesn't work, we should error out if we get a nullptr, until we find a valid testcase where nullptr is expected. I am busy for the next couple days so I will work on this after sometime, but meanwhile if this change turns any buildbots green and is required sooner, I will be able to review the change if required. Thank you for pointing this issue out.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71989



More information about the llvm-commits mailing list