[PATCH] Implement shift ops for Mips fast-isel

reed kotler rkotler at mips.com
Fri Feb 27 15:22:56 PST 2015


================
Comment at: lib/Target/Mips/MipsFastISel.cpp:1297
@@ +1296,3 @@
+  switch (DVT.SimpleTy) {
+  default:
+    // Trunc i64 to i32 is handled by the target-independent fast-isel.
----------------
echristo wrote:
> I'd add this assert:
> 
> assert((DVT.SimpleTy != MVT::i32 && DVT.SimpleTy != MVT::i64) && "i64 and i32 should have been handled by target-independent fast-isel!");
If we want to add that then why not just a simple LLVM_Unreachable ??

================
Comment at: lib/Target/Mips/MipsFastISel.cpp:1448
@@ +1447,3 @@
+    default:
+      llvm_unreachable("Unexpected instruction.");
+    case Instruction::Shl:
----------------
echristo wrote:
> Is this an actual error or what?
I think it should be impossible to get that because we are only calling this function upon seeing one of those instructions. I think I added that case to avoid compiler warnings when compiling this.

In fastSelectionInstruction

  case Instruction::Shl:
  case Instruction::LShr:
  case Instruction::AShr:
    return selectShift(I);



================
Comment at: lib/Target/Mips/MipsFastISel.cpp:1473
@@ +1472,3 @@
+  default:
+    llvm_unreachable("Unexpected instruction.");
+  case Instruction::Shl:
----------------
echristo wrote:
> Is this an actual error or what?
I think it should be impossible to get that because we are only calling this function upon seeing one of those instructions. I think I added that case to avoid compiler warnings when compiling this.

http://reviews.llvm.org/D6726

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list