diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-26 20:52:40 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-26 20:52:40 +0000 |
commit | 3bcbbece1998c52b78ff07eb9796c21d3eda7b3e (patch) | |
tree | 6a77de1738a881c6ce3df973c9e905b4da31c8cb /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 3c4dc434eee3f30e19e0d0cf5c7747e458904137 (diff) | |
download | bcm5719-llvm-3bcbbece1998c52b78ff07eb9796c21d3eda7b3e.tar.gz bcm5719-llvm-3bcbbece1998c52b78ff07eb9796c21d3eda7b3e.zip |
Don't select binary instructions with illegal types.
llvm-svn: 55383
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 81889283532..965fc022868 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -30,6 +30,12 @@ bool FastISel::SelectBinaryOp(Instruction *I, ISD::NodeType ISDOpcode, if (VT == MVT::Other || !VT.isSimple()) // Unhandled type. Halt "fast" selection and bail. return false; + // We only handle legal types. For example, on x86-32 the instruction + // selector contains all of the 64-bit instructions from x86-64, + // under the assumption that i64 won't be used if the target doesn't + // support it. + if (!TLI.isTypeLegal(VT)) + return false; unsigned Op0 = ValueMap[I->getOperand(0)]; if (Op0 == 0) |