[all-commits] [llvm/llvm-project] bd2430: [IR] Allow type change in ValueAsMetadata::handleR...
Jannik Silvanus via All-commits
all-commits at lists.llvm.org
Thu Jan 18 07:01:35 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: bd2430b4216f4f4f4432bc86cc8d7e1b7a71f56c
https://github.com/llvm/llvm-project/commit/bd2430b4216f4f4f4432bc86cc8d7e1b7a71f56c
Author: Jannik Silvanus <37809848+jasilvanus at users.noreply.github.com>
Date: 2024-01-18 (Thu, 18 Jan 2024)
Changed paths:
M llvm/lib/IR/Metadata.cpp
M llvm/unittests/IR/MetadataTest.cpp
Log Message:
-----------
[IR] Allow type change in ValueAsMetadata::handleRAUW (#76969)
`ValueAsMetadata::handleRAUW` is a mechanism to replace all metadata
referring to one value by a different value.
Relax an assert that used to enforce the old and new value to have the
same type.
This seems to be a sanity plausibility assert only, as the
implementation actually supports mismatching types.
This is motivated by a downstream mechanism where we use poison
ValueAsMetadata values to annotate pointee types of opaque pointer
function arguments.
When replacing one type with a different one to work around DXIL vs LLVM
incompatibilities, we need to update type annotations, and handleRAUW is
more efficient than creating new MD nodes.
More information about the All-commits
mailing list