[llvm] Don't rely on undefined behavior to store how a `User` object's allocation is laid out (PR #105714)
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 3 17:11:28 PDT 2024
rnk wrote:
I've been reviewing the Use system code, and we already pass in a dead `Use*` parameter to the `User` ctor. Every User subclass already knows if it uses fixed, variadic, or hung off operands. I think we can just feed that same data up the inherited constructor call graph, or rely on OperandTraits<decltype(*this)> to figure it out, or something. We really just need to pass in two bits: 1. if the uses are hung off (allocated separately) 2. if there is a descriptor
All the fixed operand call sites can pass the false / zero / no-op-flag values to an updated User constructor, and while we're at it, we can drop the dead Use operand list pointer.
https://github.com/llvm/llvm-project/pull/105714
More information about the llvm-commits
mailing list