r261464 added a type called ConstantData to the Value hierarchy. This
is a parent type for constants with no operands, such as i32 0 and null.
Since then, I've removed most instances of iterating through the
use-lists of an instance of ConstantData. I'd like to make this
illegal. Since the users of ConstantData are spread across an
LLVMContext, most code that looks at the users is wrong. Adding an
assertion should catch a lot of bugs (see r263853 and r263875) and
avoid some expensive walks through uninteresting code.
(The same is not true of Constant, generally. A GlobalValue's use-list
will local to the GlobalValue's Module. Any ConstantVector,
ConstantArray, or ConstantStruct that points at a GlobalValue will also
be local to the same Module. In these cases, we also need RAUW
support.)
Besides catching bugs, removing use-lists from ConstantData will
guarantee that the compiler output *does not* depend on the use-list
order of something like i32 0.
Finally, this should dramatically reduce the overhead of serializing
use-list order in bitcode. We will no longer track the arbitrary
order of references to things like i32 0 and null.
What's left?
0001-WIP-HACK-SimplifyLibCalls-Disable-optimizeSinCosPi-o.patch (1.84 KB)
0002-WIP-HACK-LICM-Ignore-stores-to-UndefValue-and-Consta.patch (2.18 KB)
0003-WIP-IR-Remove-use-lists-from-ConstantData.patch (17.8 KB)