[llvm] r345868 - [Hexagon] Fix MO_JumpTable const extender conversion

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 11:14:45 PDT 2018


Author: rnk
Date: Thu Nov  1 11:14:45 2018
New Revision: 345868

URL: http://llvm.org/viewvc/llvm-project?rev=345868&view=rev
Log:
[Hexagon] Fix MO_JumpTable const extender conversion

Previously this case fell through to unreachable, so it is clearly not
covered by any test case in LLVM. It may be dynamically unreachable, in
fact. However, if it were to run, this is what it would logically do.
The assert suggests that the intended behavior was not to allow folding
offsets from jump table indices, which makes sense.

Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp

Modified: llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp?rev=345868&r1=345867&r2=345868&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonConstExtenders.cpp Thu Nov  1 11:14:45 2018
@@ -788,6 +788,7 @@ HCE::ExtValue::operator MachineOperand()
       return MachineOperand::CreateCPI(V.ImmVal, Offset, TF);
     case MachineOperand::MO_JumpTableIndex:
       assert(Offset == 0);
+      return MachineOperand::CreateJTI(V.ImmVal, TF);
     default:
       llvm_unreachable("Unhandled kind");
  }




More information about the llvm-commits mailing list