<div dir="ltr">The attached patch removes PseudoSourceValue from the Value hierarchy. No functionality change intended, but I had to make a number of assumptions in order to make that claim. I assume nobody ever assigned names to PSV's. I assume nobody has an AliasAnalysis that is smart about PSV's (it's not in tree). That sort of thing.<div>

<br></div><div>I'm going to say up front, this patch isn't entirely pretty. There's some PointerUnions involved. Some code did get nicer, there were users that had tests for Value* then if isa<PseudoSourceValue> do something that would end in an unconditional return or continue, then afterwards handle non-PSV Value's. These are now sensible conditions for the two cases. Some code got worse. Target/Mips wins the contest for actually having code that treated PSV's and Value's through the same code paths, good job guys! Sorry that I'm doing this to you.</div>

<div><br></div><div>At its core, this patch makes PseudoSourceValue the root of its own hierarchy with just itself and FixedPseudoSourceValue in it, then updated MachinePointerInfo to store a pointer-union of the PSV and Value*. Various bits of code throughout lib/CodeGen and lib/Target are updated to pass MPI's around instead of extracting the Value* from an MPI, passing that, then rebuilding the MPI on the other end. Such code was silly anyways.</div>

<div><br></div><div>Please review. Before we get a low-level code review, I'm expecting to be told that I've violated some design criteria of the backend that I wasn't aware of. I mean, I moved a method from private to public, so that's a pretty big sign. Please feel free to tell me how things ought to be layered.</div>

<div><br></div><div>Nick</div><div><br></div></div>