diff options
author | Justin Holewinski <justin.holewinski@gmail.com> | 2011-06-20 17:08:56 +0000 |
---|---|---|
committer | Justin Holewinski <justin.holewinski@gmail.com> | 2011-06-20 17:08:56 +0000 |
commit | cad129bcc0a23d1acfb6560f12ff1066c7b42ba0 (patch) | |
tree | 717f42e80a03b9a08d436ba41381cb3744171efb /lib/Target | |
parent | b87e37f1b1ce76e34ac1d2c22fd6c22f900f28be (diff) | |
download | external_llvm-cad129bcc0a23d1acfb6560f12ff1066c7b42ba0.zip external_llvm-cad129bcc0a23d1acfb6560f12ff1066c7b42ba0.tar.gz external_llvm-cad129bcc0a23d1acfb6560f12ff1066c7b42ba0.tar.bz2 |
PTX: Fix if-then-else formatting and add missing asserts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/PTX/PTXInstrInfo.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/Target/PTX/PTXInstrInfo.cpp b/lib/Target/PTX/PTXInstrInfo.cpp index c827819..c4f6cbd 100644 --- a/lib/Target/PTX/PTXInstrInfo.cpp +++ b/lib/Target/PTX/PTXInstrInfo.cpp @@ -304,18 +304,16 @@ void PTXInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB, // Select the appropriate opcode based on the register class if (RC == PTX::RegI16RegisterClass) { OpCode = PTX::STACKSTOREI16; - } - else if (RC == PTX::RegI32RegisterClass) { + } else if (RC == PTX::RegI32RegisterClass) { OpCode = PTX::STACKSTOREI32; - } - else if (RC == PTX::RegI64RegisterClass) { + } else if (RC == PTX::RegI64RegisterClass) { OpCode = PTX::STACKSTOREI32; - } - else if (RC == PTX::RegF32RegisterClass) { + } else if (RC == PTX::RegF32RegisterClass) { OpCode = PTX::STACKSTOREF32; - } - else if (RC == PTX::RegF64RegisterClass) { + } else if (RC == PTX::RegF64RegisterClass) { OpCode = PTX::STACKSTOREF64; + } else { + llvm_unreachable("Unknown PTX register class!"); } // Build the store instruction (really a mov) @@ -341,18 +339,16 @@ void PTXInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, // Select the appropriate opcode based on the register class if (RC == PTX::RegI16RegisterClass) { OpCode = PTX::STACKLOADI16; - } - else if (RC == PTX::RegI32RegisterClass) { + } else if (RC == PTX::RegI32RegisterClass) { OpCode = PTX::STACKLOADI32; - } - else if (RC == PTX::RegI64RegisterClass) { + } else if (RC == PTX::RegI64RegisterClass) { OpCode = PTX::STACKLOADI32; - } - else if (RC == PTX::RegF32RegisterClass) { + } else if (RC == PTX::RegF32RegisterClass) { OpCode = PTX::STACKLOADF32; - } - else if (RC == PTX::RegF64RegisterClass) { + } else if (RC == PTX::RegF64RegisterClass) { OpCode = PTX::STACKLOADF64; + } else { + llvm_unreachable("Unknown PTX register class!"); } // Build the load instruction (really a mov) |