[Mlir-commits] [mlir] [mlir][LLVMIR] Add folder pass for `llvm.inttoptr` and `llvm.ptrtoint` (PR #143066)
Diego Caballero
llvmlistbot at llvm.org
Fri Jun 6 12:51:08 PDT 2025
dcaballe wrote:
>> This fold is incorrect, because the resulting pointer may have different provenance. We probably should not copy known-incorrect folds from LLVM to MLIR...
>
>Ouch! I was afraid of provenance issue, and trusted InstCombine as a reference to assume this one is OK :(
Thanks for chiming in here though!
Thanks for the feedback. I'm not versed at all in pointer provenance and I'm lost if LLVM is not a valid reference implementation. Is there any way forward here? Would further checks (e.g., `ptrtoint` has only `inttoptr` as a user) make any of the foldings safe? Sorry if I'm asking something obvious. I'd appreciate some guidance here. Thanks!
https://github.com/llvm/llvm-project/pull/143066
More information about the Mlir-commits
mailing list