jdoerfert accepted this revision. jdoerfert added a comment. This revision is now accepted and ready to land.
Let's move on. I described what this should look like, just for the record. ================ Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:10399 + DeviceID = CGF.Builder.getInt64(OMP_DEVICEID_UNDEF); + } ---------------- TIFitis wrote: > jdoerfert wrote: > > Move this behind the if generation and guard the emit scalar with a > > conditional, all is only needed if both Device is present and IfCond is not > > known true. > I have moved the device generation after the if generation. > But I am not sure what should be the guard here for emitting the scalar. > > My idea was to generate something like: > > > ``` > %new_dev = alloca ... > if.then > %x = load %device > store %x %new_dev > ... > begin_mapper(..., %new_dev, ...) > ... > if.then > ... > end_mapper(..., %new_dev, ...) > ``` What we should do, though I don't think it will really matter, is the following: ``` device_val = undef; if_val = eval_if_clause(); if (id_val) { device_val = eval_device_clause() ...other clauses ... begin_then(... Vals ...) } else { begin_else(...) } if (if_val) { end_then(... Vals ...) } else { end_else(...) } ``` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D150860/new/ https://reviews.llvm.org/D150860 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits