[Mlir-commits] [llvm] [mlir] [OMPIRBuilder][OpenMP][LLVM] Modify and use ReplaceConstant utility in convertTarget (PR #94541)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Jun 12 12:23:38 PDT 2024


agozillon wrote:

> > The one possible downside to this replacement is that the constant -> instruction rewriting is no longer constrained to within the kernel, it will expand the available uses of an input argument that is constant and has constant uses in the module. This hasn't lowered the correctness of the examples I have tested with (so far at least, it has only increased correctness e.g. test added in this PR), however, it may impact performance, a possibility in the future may be to optionally constrain rewrites of uses of constants in convertUsersOfConstantsToInstructions to a provided llvm::Function.
> 
> I'd feel more comfortable with this if it did not change other functions. It seems like supporting this in convertUsersOfConstantsToInstructions would just be one extra check when creating the InstructionWorklist, so maybe just go ahead and do it now?

Can do so! I was a bit hesitant to do it without some input as I wasn't sure exactly the best place to put the check to constrain it. But it should only take one extra check and an extra argument for the current function/kernel the conversion should be restricted to (at least from my simplistic understanding of the function)

https://github.com/llvm/llvm-project/pull/94541


More information about the Mlir-commits mailing list