domada added a comment.

In D151445#4372892 <https://reviews.llvm.org/D151445#4372892>, @clementval 
wrote:

> You should be able to get this information from the source location in MLIR.

Hi, thank you for your quick feedback.

You are right, the source location is provided in MLIR. Unfortunately, when we 
compile the source code with -save-temps file, then we use preprocessed file as 
the input for MLIR and we have no information about original source file.

Please look at the output of the command:
`flang-new -save-temps -v **test.f90**`

Output:
`flang-new -fc1 /*some fc1 options */ **-o test.i test.f90**`
`flang-new -fc1 /*some fc1 options */ **-o test.bc test.i**`

If we generate the code for OpenMP, then we generate two different preprocessed 
files (one for host code, the second one for the device). Then we use these 
preprocessed files as the input for MLIR. Originally we use the name of 
preprocessed file as the input for generation of unique name of OpenMP kernel 
function (please look at the original code inside 
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp  ). In 
consequence we generate two different kernel names for host and the device 
module (host and the device code should operate on the same name of the kernel 
function). To fix that isssue I provide an information about the original 
source file (not the name of the input preprocessed file).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151445

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to