diff options
author | Justin Holewinski <jholewinski@nvidia.com> | 2013-08-06 14:13:31 +0000 |
---|---|---|
committer | Justin Holewinski <jholewinski@nvidia.com> | 2013-08-06 14:13:31 +0000 |
commit | a3635eefc749389aed84d9791fab657297203e1b (patch) | |
tree | 613f5d28fe902b437c84eebdf89c60eb5f60c9ce /lib/Target/NVPTX/InstPrinter | |
parent | 82767327c59ede1f8663ec9b9a64a668993d501f (diff) | |
download | external_llvm-a3635eefc749389aed84d9791fab657297203e1b.zip external_llvm-a3635eefc749389aed84d9791fab657297203e1b.tar.gz external_llvm-a3635eefc749389aed84d9791fab657297203e1b.tar.bz2 |
[NVPTX] Fix bug in stack code generation causes by MC conversion
We do use a very small set of physical registers, so account for
them in the virtual register encoding between MachineInstr and MC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/NVPTX/InstPrinter')
-rw-r--r-- | lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp b/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp index 1cb8a9a..c7b8aa4 100644 --- a/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp +++ b/lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp @@ -41,21 +41,26 @@ void NVPTXInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { switch (RCId) { default: report_fatal_error("Bad virtual register encoding"); case 0: + // This is actually a physical register, so defer to the autogenerated + // register printer + OS << getRegisterName(RegNo); + return; + case 1: OS << "%p"; break; - case 1: + case 2: OS << "%rs"; break; - case 2: + case 3: OS << "%r"; break; - case 3: + case 4: OS << "%rl"; break; - case 4: + case 5: OS << "%f"; break; - case 5: + case 6: OS << "%fl"; break; } |