diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-05 18:44:22 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-05 18:44:22 +0000 |
commit | fd634599dc1847f83d50a3a3c05827ee0d2c6c38 (patch) | |
tree | eaa2af7081ada26f76143dfe29f10ebf469281c9 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 520143e563f75245eef230afee63f2bc2d868165 (diff) | |
download | bcm5719-llvm-fd634599dc1847f83d50a3a3c05827ee0d2c6c38.tar.gz bcm5719-llvm-fd634599dc1847f83d50a3a3c05827ee0d2c6c38.zip |
FastISel support for AND and OR with type i1.
llvm-svn: 55846
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 220be221d56..992b8edba4d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -103,12 +103,20 @@ bool FastISel::SelectBinaryOp(User *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; + if (!TLI.isTypeLegal(VT)) { + // MVT::i1 is special. Allow AND and OR (but not XOR) because they + // don't require additional zeroing, which makes them easy. + if (VT == MVT::i1 && + (ISDOpcode == ISD::AND || ISDOpcode == ISD::OR)) + VT = TLI.getTypeToTransformTo(VT); + else + return false; + } unsigned Op0 = getRegForValue(I->getOperand(0)); if (Op0 == 0) |