From: Justin Holewinski Date: Wed, 5 Oct 2011 18:32:25 +0000 (+0000) Subject: PTX: Fixup a case where getRegClassFor() should be used instead of custom code. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=591c1c6754534fb72b4ca8d8444db4ddc4385e80;p=oota-llvm.git 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 --- diff --git a/lib/Target/PTX/PTXISelLowering.cpp b/lib/Target/PTX/PTXISelLowering.cpp index a624b5a201b..f2234906d9d 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.