[PATCH] D130466: [LICM] - Add option to allow data races

Shubham Narlawar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 06:09:11 PDT 2022


gsocshubham added a comment.

In D130466#3719718 <https://reviews.llvm.org/D130466#3719718>, @efriedma wrote:

> The clang changes are sort of right, in the sense that it's getting value of the right flag to the right place, but it's not how we pass around that sort of information.
>
> Usually, we do one of two things:
>
> - Treat it as a property of the target, and add a method to TargetTransformInfo to retrieve it from the target.

@efriedma - `ThreadModel` is available in `TargetOptions`, how can i make it visible in `TargetTransformInfo`?

1. I do not see any usage of ThreadModel in CodeGen/Transforms/Target. I see it in only in the front end.
2. The only way I can think of is to pass information from clang to CodeGen and then store it in TargetTransformInfo and then use it in LICM. Can you point me to an example which is already present which does it? It would be helpful.

Clang             -> CodeGen                 -> Transform
//exist here     //how to store here   //want to use here

In above patch, I passed ThreadModel from Clang to Transform but passing from Clang to CodeGen seems correct. Can you point me to such example?

> - Encode the information directly in the IR, as a function attribute or something like that.

The second approach does not seem feasible in this case as the information might be lost till the time it reaches LICM. I will go with (1).


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

https://reviews.llvm.org/D130466



More information about the llvm-commits mailing list