[llvm-commits] [llvm] r141182 - /llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Wed Oct 5 10:09:30 PDT 2011
On Oct 5, 2011, at 8:11 AM, Duncan Sands wrote:
> Modified: llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp?rev=141182&r1=141181&r2=141182&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/PTX/PTXISelLowering.cpp Wed Oct 5 10:11:08 2011
> @@ -237,36 +237,22 @@
> for (unsigned i = 0, e = Ins.size(); i != e; ++i) {
> EVT RegVT = Ins[i].VT;
> TargetRegisterClass* TRC = 0;
> - int OpCode;
>
> // Determine which register class we need
> - if (RegVT == MVT::i1) {
> + if (RegVT == MVT::i1)
> TRC = PTX::RegPredRegisterClass;
> - OpCode = PTX::READPARAMPRED;
> - }
> - else if (RegVT == MVT::i16) {
> + else if (RegVT == MVT::i16)
> TRC = PTX::RegI16RegisterClass;
> - OpCode = PTX::READPARAMI16;
> - }
> - else if (RegVT == MVT::i32) {
> + else if (RegVT == MVT::i32)
> TRC = PTX::RegI32RegisterClass;
> - OpCode = PTX::READPARAMI32;
> - }
> - else if (RegVT == MVT::i64) {
> + else if (RegVT == MVT::i64)
> TRC = PTX::RegI64RegisterClass;
> - OpCode = PTX::READPARAMI64;
> - }
> - else if (RegVT == MVT::f32) {
> + else if (RegVT == MVT::f32)
> TRC = PTX::RegF32RegisterClass;
> - OpCode = PTX::READPARAMF32;
> - }
> - else if (RegVT == MVT::f64) {
> + else if (RegVT == MVT::f64)
> TRC = PTX::RegF64RegisterClass;
> - OpCode = PTX::READPARAMF64;
> - }
> - else {
> + else
> llvm_unreachable("Unknown parameter type");
> - }
At this point, you could simply use TRC = getRegClassFor(RegVT), right?
/jakob
More information about the llvm-commits
mailing list