[llvm] [IR] Allow type change in ValueAsMetadata::handleRAUW (PR #76969)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 05:38:55 PST 2024


SLTozer wrote:

> I considered this, but I think such a constraint would be a bit arbitrary. What about `undef`? Zero? There doesn't seem to be a fundamental reason to forbid such type changes.
> 

I think your current approach is fine so no need to adjust but FWIW, though it may be arbitrary, `UndefValue` and `PoisonValue` by extension do have special meaning in metadata contexts since it's what we use to represent dead debug values; by the sounds of it it's also being given a special meaning in your downstream context, so - noting this for posterity's sake only, in case this comes up again - I think there's a fair argument to start giving it special treatment, or else to actually define a new Value-type that is expected to only appear in metadata contexts to be used for both these cases (which would prevent unrelated changes in IR semantics/style from requiring debug info rewrites, as with the UndefValue->PoisonValue updates).


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


More information about the llvm-commits mailing list