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 | 0254ba1639d3ab02a8c5be6466f4eed9efe94cf6 (patch) | |
tree | 46ad8cba409efa705fc57d8d0cc09200244f409d /lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | f579570994627d4a0aa2837019002e62c67b90a3 (diff) | |
download | external_llvm-0254ba1639d3ab02a8c5be6466f4eed9efe94cf6.zip external_llvm-0254ba1639d3ab02a8c5be6466f4eed9efe94cf6.tar.gz external_llvm-0254ba1639d3ab02a8c5be6466f4eed9efe94cf6.tar.bz2 |
Don't select binary instructions with illegal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 8188928..965fc02 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/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) |