[llvm] [NFC][NVPTX] Introduce AS aware address matching in TableGen (PR #210309)

Rajat Bajpai via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 18 11:29:07 PDT 2026


rajatbajpai wrote:

That’s a fair point, the address space is a property of the memory operation, not the address itself.

However, other backends already combine address selection with the parent memory node in a similar way. X86’s `selectAddr` reads `cast<MemSDNode>(Parent)->getPointerInfo().getAddrSpace()` to select segment registers. Similarly, AMDGPU’s `SelectFlatOffsetImpl` uses `findMemSDNode(N)->getAddressSpace()` when selecting `FlatOffset` or `ScratchOffset`. The one difference is that those targets use the AS to guide how the address is folded, while in our case it’s an accept/reject filter.

IMO, the proposed approach provides better ergonomics because the constraint is visible directly at the use site as `addr_const:$src`. I think that benefit outweighs the small semantic deviation.



https://github.com/llvm/llvm-project/pull/210309


More information about the llvm-commits mailing list