]> granicus.if.org Git - llvm/commit
TableGen: Add address space to matchers
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 15 Jul 2019 20:59:42 +0000 (20:59 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 15 Jul 2019 20:59:42 +0000 (20:59 +0000)
commit4783e3ce2b3c1115d149839d5ed61955f7ea627f
treec0c2a8347e004edf73370d10e0c52c0a9bb12f6c
parenta985f4ba1574974d3fa9b7d7bfd6675a776f133a
TableGen: Add address space to matchers

Currently AMDGPU uses a CodePatPred to check address spaces from the
MachineMemOperand. Introduce a new first class property so that the
existing patterns can be easily modified to uses the new generated
predicate, which will also be handled for GlobalISel.

I would prefer these to match against the pointer type of the
instruction, but that would be difficult to get working with
SelectionDAG compatbility. This is much easier for now and will avoid
a painful tablegen rewrite for all the loads and stores.

I'm also not sure if there's a better way to encode multiple address
spaces in the table, rather than putting the number to expect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366128 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/InstructionSelector.h
include/llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h
include/llvm/Target/TargetSelectionDAG.td
test/TableGen/address-space-patfrags.td [new file with mode: 0644]
utils/TableGen/CodeGenDAGPatterns.cpp
utils/TableGen/CodeGenDAGPatterns.h
utils/TableGen/GlobalISelEmitter.cpp