Nikita Popov
Nikita Popov
I don't think that something like `var: Var#10` is a sensible representation for variable variables. We should be generating a separate operation the looks up a variable by name. The...
@ircmaxell Yes, that would be the semantically accurate modelling. I'm not sure modelling this in full accuracy (rather than just "don't crash" and "make it easy to detect") is going...
@sayantn Taking the address of an intrinsic is invalid LLVM IR.
This should probably be a general ptrtoint(ptradd(p, o)) to add(ptrtoint(p), o) fold.
@saethlin Yeah, the problem there is that we need to look through a very deep sequence of selects to determine that the final pointer is actually guaranteed to be non-null....
https://github.com/llvm/llvm-project/pull/106090 should fix both the unrolled and not unrolled cases.
I'd like to defer this until after https://github.com/llvm/llvm-project/pull/88217, which would address my primary concern with this (the ever present undef footgun).
> > Please attach alive2 proofs and pre-commit tests. > > Okay, I've attached a proof, could you explain further about what you mean by pre-commit tests? See https://llvm.org/docs/InstCombineContributorGuide.html#precommit-tests.
I think this should be a minor generalization of some existing simplifyWithOpReplaced or foldSelectValueEquivalence style fold.