summaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/DAGISelMatcherGen.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-07-22 15:02:34 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-07-22 15:02:34 +0000
commit542720b2bc48d243d2eec93157feebc37af0e202 (patch)
tree329e82ce7ea94f5afa8290491bd0debe65636265 /llvm/utils/TableGen/DAGISelMatcherGen.cpp
parent1b2da771f561affe36eb5eb0c7a3d2862c5a5c1c (diff)
TableGen: Support physical register inputs > 255
This was truncating register value that didn't fit in unsigned char. Switch AMDGPU sendmsg intrinsics to using a tablegen pattern. llvm-svn: 366695
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherGen.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index 8f54beeba65b..c6fb05c6364c 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -867,9 +867,13 @@ EmitResultInstructionAsOperand(const TreePatternNode *N,
if (isRoot && !PhysRegInputs.empty()) {
// Emit all of the CopyToReg nodes for the input physical registers. These
// occur in patterns like (mul:i8 AL:i8, GR8:i8:$src).
- for (unsigned i = 0, e = PhysRegInputs.size(); i != e; ++i)
+ for (unsigned i = 0, e = PhysRegInputs.size(); i != e; ++i) {
+ const CodeGenRegister *Reg =
+ CGP.getTargetInfo().getRegBank().getReg(PhysRegInputs[i].first);
AddMatcher(new EmitCopyToRegMatcher(PhysRegInputs[i].second,
- PhysRegInputs[i].first));
+ Reg));
+ }
+
// Even if the node has no other glue inputs, the resultant node must be
// glued to the CopyFromReg nodes we just generated.
TreeHasInGlue = true;