[PATCH] D150860: [OpenMP] Change clang emitTargetDataCalls to use OMPIRBuilder

Jan Sjödin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 07:45:13 PDT 2023


jsjodin added inline comments.


================
Comment at: clang/test/OpenMP/target_data_codegen.cpp:355-356
 // Region 00
+// CK2-DAG: [[DEV:%[^,]+]] = sext i32 [[DEVi32:%[^,]+]] to i64
+// CK2-DAG: [[DEVi32]] = load i32, ptr %{{[^,]+}},
 // CK2: br i1 %{{[^,]+}}, label %[[IFTHEN:[^,]+]], label %[[IFELSE:[^,]+]]
----------------
TIFitis wrote:
> When both if clause and device clause are present, the device clause argument is inadvertently brought outside the `IfThen` region as we emit the `llvm:Value` from the `Clang::Expr` for it before making call to createTargetData.
> 
> I don't think this change would affect any use cases.
> When both if clause and device clause are present, the device clause argument is inadvertently brought outside the `IfThen` region as we emit the `llvm:Value` from the `Clang::Expr` for it before making call to createTargetData.
> 
> I don't think this change would affect any use cases.

Is it at all possible that the load could cause an exception if moved outside the if?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150860



More information about the cfe-commits mailing list