Skip to content

Commit

Permalink
Merging r243986:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
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
------------------------------------------------------------------------

llvm-svn: 244092
  • Loading branch information
zmodem committed Aug 5, 2015
1 parent e51925f commit 7d37d0c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions llvm/lib/Target/Mips/MipsFastISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ unsigned MipsFastISel::emitLogicalOp(unsigned ISDOpc, MVT RetVT,
}

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.");

Expand Down Expand Up @@ -377,6 +380,9 @@ unsigned MipsFastISel::materializeExternalCallSym(MCSymbol *Sym) {
// 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.
Expand Down Expand Up @@ -1234,6 +1240,9 @@ bool MipsFastISel::finishCall(CallLoweringInfo &CLI, MVT RetVT,
}

bool MipsFastISel::fastLowerCall(CallLoweringInfo &CLI) {
if (!TargetSupported)
return false;

CallingConv::ID CC = CLI.CallConv;
bool IsTailCall = CLI.IsTailCall;
bool IsVarArg = CLI.IsVarArg;
Expand Down Expand Up @@ -1318,6 +1327,9 @@ bool MipsFastISel::fastLowerCall(CallLoweringInfo &CLI) {
}

bool MipsFastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
if (!TargetSupported)
return false;

switch (II->getIntrinsicID()) {
default:
return false;
Expand Down

0 comments on commit 7d37d0c

Please sign in to comment.