This is built on top of https://reviews.llvm.org/D21688 (not yet committed). Instead of taking the address space as an argument in the constructor we use a the target and callback inside the constructor since the source kind should have enough information for the target to decide which address space to use. This also contains the changes in the rest of the compiler to use the new interface. The TII argument does not have a default value (nullptr) because it should be explicit that the target is not needed and the generic address space will be used in all cases, otherwise it is easy to forget and could cause bugs that would be hard to find.
Details
Diff Detail
Event Timeline
lib/CodeGen/PseudoSourceValue.cpp | ||
---|---|---|
30 | If it's required, TII should be a reference or at least this should assert | |
lib/Target/AMDGPU/SIInstrInfo.cpp | ||
1771–1775 | These should all be CONSTANT_ADDRESS | |
1777 | Prefereable to use the enum value rather than 0 | |
lib/Target/Mips/MipsMachineFunction.cpp | ||
96 ↗ | (On Diff #105530) | I thought the PSVManager held a TII reference? |
lib/CodeGen/PseudoSourceValue.cpp | ||
---|---|---|
30 | Yes, I think it may be better to have an assert. That way we don't have to dereference any pointers at the call sites. My initial idea was that if the target only has a generic address space there would be no need for TII, so a nullptr would be okay, but it would at least be explicit in the call, but that may be more confusing. I will fix this. | |
lib/Target/Mips/MipsMachineFunction.cpp | ||
96 ↗ | (On Diff #105530) | I wasn't sure, but in that case we can use TII, and put an assert in the PSV constructor. |
Make TII mandatory (assert if given nullptr) in PSV constructor. Add TII as a member to the PSV manager so that it is not needed in the method calls.
Ping.
Any progress? D35361 relies on this patch and we need it to fix vload_private/vstore_private failure with new address space mapping.
lib/CodeGen/PseudoSourceValue.cpp | ||
---|---|---|
30 | Yes. it can be made into a reference. I will post a new patch with this. |
If it's required, TII should be a reference or at least this should assert