[PATCH] D28145: [OpenMP] Basic support for a parallel directive in a target region on an NVPTX device.
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 9 05:46:59 PST 2017
Arpith, I'm afraid that bool type is translated to i8 or even to i32 type rather than to i1. I believe you'd better to use CGF.ConvertTypeForMem(Context.getBoolType())to get the correct return type for bool rather than simply i1. You'd better to check how bool(...) function type is converted to LLVM IR.
> 9 янв. 2017 г., в 15:09, Arpith Jacob via Phabricator <reviews at reviews.llvm.org> написал(а):
> arpith-jacob marked 2 inline comments as done.
> arpith-jacob added inline comments.
> Comment at: lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:365
> + llvm::FunctionType *FnTy =
> + llvm::FunctionType::get(llvm::Type::getInt1Ty(CGM.getLLVMContext()),
> + TypeParams, /*isVarArg*/ false);
> ABataev wrote:
>> Does it really return I1 type? Or I8?
> Alexey, the runtime function is called by every worker thread. It returns a 'bool' that indicates if the thread has been activated in the parallel region, which is why I used an Int1Ty. Please let me know if you see problems with this. Thanks.
More information about the cfe-commits