]> granicus.if.org Git - llvm/commitdiff
[X86] Remove dead code from X86ISelDAGToDAG.cpp multiply handling
authorCraig Topper <craig.topper@intel.com>
Thu, 28 Sep 2017 16:56:36 +0000 (16:56 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 28 Sep 2017 16:56:36 +0000 (16:56 +0000)
Summary:
Lowering never creates X86ISD::UMUL for 8-bit types. X86ISD::UMUL8 is used instead. If X86ISD::UMUL 8-bit were ever used it would crash.

DAGCombiner replaces UMUL_LOHI/SMUL_LOHI with a wider MUL and a shift if the type twice as wide is legal. So we should never see i8 UMUL_LOHI/SMUL_LOHI. In fact I think there was a bug in part of the i8 code. Similar is true for i16 though without the bug.

Reviewers: RKSimon, spatel, zvi

Reviewed By: zvi

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38276

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314430 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelDAGToDAG.cpp

index 250d250af353f13937b81c7023287af831efe3ba..84b1f9624ad9f1301e54ff160c6d41211ec3a2e4 100644 (file)
@@ -2594,7 +2594,7 @@ void X86DAGToDAGISel::Select(SDNode *Node) {
     unsigned LoReg;
     switch (NVT.SimpleTy) {
     default: llvm_unreachable("Unsupported VT!");
-    case MVT::i8:  LoReg = X86::AL;  Opc = X86::MUL8r; break;
+    // MVT::i8 is handled by X86ISD::UMUL8.
     case MVT::i16: LoReg = X86::AX;  Opc = X86::MUL16r; break;
     case MVT::i32: LoReg = X86::EAX; Opc = X86::MUL32r; break;
     case MVT::i64: LoReg = X86::RAX; Opc = X86::MUL64r; break;