[llvm-branch-commits] [llvm-branch] r244092 - Merging r243986:

Hans Wennborg hans at hanshq.net
Wed Aug 5 11:43:33 PDT 2015


Author: hans
Date: Wed Aug  5 13:43:33 2015
New Revision: 244092

URL: http://llvm.org/viewvc/llvm-project?rev=244092&view=rev
Log:
Merging r243986:
------------------------------------------------------------------------
r243986 | vkalintiris | 2015-08-04 07:35:50 -0700 (Tue, 04 Aug 2015) | 14 lines

[mips][FastISel] Disable code generation for unsupported targets through FastISel.

Summary:
Previously, we would check whether the target is supported or not, only in
fastSelectInstruction(). This means that 64-bit targets could use FastISel too.
We fix this by checking every overridden method of the FastISel class and
by falling back to SelectionDAG if the target isn't supported. This change
should have been committed along with r243638, but somehow I missed it.

Reviewers: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11755
------------------------------------------------------------------------

Modified:
    llvm/branches/release_37/   (props changed)
    llvm/branches/release_37/lib/Target/Mips/MipsFastISel.cpp

Propchange: llvm/branches/release_37/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug  5 13:43:33 2015
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,242236,242239,242281,242288,242296,242331,242341,242410,242412,242433-242434,242442,242543,242673,242680,242706,242721-242722,242733-242735,242742,242869,242919,242993,243001,243057,243116,243263,243294,243361,243469,243485,243500,243519,243531,243589,243609,243636,243638-243640,243745
+/llvm/trunk:155241,242236,242239,242281,242288,242296,242331,242341,242410,242412,242433-242434,242442,242543,242673,242680,242706,242721-242722,242733-242735,242742,242869,242919,242993,243001,243057,243116,243263,243294,243361,243469,243485,243500,243519,243531,243589,243609,243636,243638-243640,243745,243986

Modified: llvm/branches/release_37/lib/Target/Mips/MipsFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_37/lib/Target/Mips/MipsFastISel.cpp?rev=244092&r1=244091&r2=244092&view=diff
==============================================================================
--- llvm/branches/release_37/lib/Target/Mips/MipsFastISel.cpp (original)
+++ llvm/branches/release_37/lib/Target/Mips/MipsFastISel.cpp Wed Aug  5 13:43:33 2015
@@ -267,6 +267,9 @@ unsigned MipsFastISel::emitLogicalOp(uns
 }
 
 unsigned MipsFastISel::fastMaterializeAlloca(const AllocaInst *AI) {
+  if (!TargetSupported)
+    return 0;
+
   assert(TLI.getValueType(DL, AI->getType(), true) == MVT::i32 &&
          "Alloca should always return a pointer.");
 
@@ -377,6 +380,9 @@ unsigned MipsFastISel::materializeExtern
 // Materialize a constant into a register, and return the register
 // number (or zero if we failed to handle it).
 unsigned MipsFastISel::fastMaterializeConstant(const Constant *C) {
+  if (!TargetSupported)
+    return 0;
+
   EVT CEVT = TLI.getValueType(DL, C->getType(), true);
 
   // Only handle simple types.
@@ -1234,6 +1240,9 @@ bool MipsFastISel::finishCall(CallLoweri
 }
 
 bool MipsFastISel::fastLowerCall(CallLoweringInfo &CLI) {
+  if (!TargetSupported)
+    return false;
+
   CallingConv::ID CC = CLI.CallConv;
   bool IsTailCall = CLI.IsTailCall;
   bool IsVarArg = CLI.IsVarArg;
@@ -1318,6 +1327,9 @@ bool MipsFastISel::fastLowerCall(CallLow
 }
 
 bool MipsFastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
+  if (!TargetSupported)
+    return false;
+
   switch (II->getIntrinsicID()) {
   default:
     return false;




More information about the llvm-branch-commits mailing list