[PATCH] D127942: [NewGVN] add context instruction for SimplifyQuery

chenglin.bi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 06:44:50 PDT 2022


bcl5980 added a comment.

In D127942#3601587 <https://reviews.llvm.org/D127942#3601587>, @fhahn wrote:

> In D127942#3598337 <https://reviews.llvm.org/D127942#3598337>, @nikic wrote:
>
>> See https://github.com/llvm/llvm-project/blob/ae76b2f455016efb8cac5519d382be575b2d2edc/llvm/lib/Analysis/ValueTracking.cpp#L133. ValueTracking currently doesn't have a way to run completely without context instruction.
>>
>> I'm also somewhat apprehensive here -- the reason why I thought this would be safe is that this is part of the computation a specific instruction -- we don't fold every place where the same expression is used. However, the operands might come from a different context (which is why we also can't UseInstrInfo). In theory, I don't think that should be an issue, but in practice it may well be.
>
> Ah right, so it sounds a better fix would be to update ValueTracking to respect `UseInstrInfo` (only set by NewGVN AFAIK, so we could also rename it/update the documentation) when picking a safe context instruction, by moving the static function to `SimplifyQuery`?

Do I need to revert current code now ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127942



More information about the llvm-commits mailing list