aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PTX
diff options
context:
space:
mode:
authorJustin Holewinski <justin.holewinski@gmail.com>2011-10-05 18:32:25 +0000
committerJustin Holewinski <justin.holewinski@gmail.com>2011-10-05 18:32:25 +0000
commit591c1c6754534fb72b4ca8d8444db4ddc4385e80 (patch)
treeb7c20dfb96bda59fec839293017accd24daaf3be /lib/Target/PTX
parent2c3bef8a15c84ad8ef043f8e8ff08ffe1b96720b (diff)
PTX: Fixup a case where getRegClassFor() should be used instead of custom code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PTX')
-rw-r--r--lib/Target/PTX/PTXISelLowering.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/lib/Target/PTX/PTXISelLowering.cpp b/lib/Target/PTX/PTXISelLowering.cpp
index a624b5a201..f2234906d9 100644
--- a/lib/Target/PTX/PTXISelLowering.cpp
+++ b/lib/Target/PTX/PTXISelLowering.cpp
@@ -236,23 +236,7 @@ SDValue PTXTargetLowering::
else {
for (unsigned i = 0, e = Ins.size(); i != e; ++i) {
EVT RegVT = Ins[i].VT;
- TargetRegisterClass* TRC = 0;
-
- // Determine which register class we need
- if (RegVT == MVT::i1)
- TRC = PTX::RegPredRegisterClass;
- else if (RegVT == MVT::i16)
- TRC = PTX::RegI16RegisterClass;
- else if (RegVT == MVT::i32)
- TRC = PTX::RegI32RegisterClass;
- else if (RegVT == MVT::i64)
- TRC = PTX::RegI64RegisterClass;
- else if (RegVT == MVT::f32)
- TRC = PTX::RegF32RegisterClass;
- else if (RegVT == MVT::f64)
- TRC = PTX::RegF64RegisterClass;
- else
- llvm_unreachable("Unknown parameter type");
+ TargetRegisterClass* TRC = getRegClassFor(RegVT);
// Use a unique index in the instruction to prevent instruction folding.
// Yes, this is a hack.