Support for i1 XOR in FastISel. It is actually safe because
authorDan Gohman <gohman@apple.com>
Thu, 25 Sep 2008 17:22:52 +0000 (17:22 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 25 Sep 2008 17:22:52 +0000 (17:22 +0000)
i1 operands are assumed to already by zero-extended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56615 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FastISel.cpp

index 254b1fe42ccd5ec0e2bf1727ab6be9b6c637790d..dcb30ad18821b5002c0adecc9db25286357a5527 100644 (file)
@@ -135,10 +135,11 @@ bool FastISel::SelectBinaryOp(User *I, ISD::NodeType ISDOpcode) {
   // under the assumption that i64 won't be used if the target doesn't
   // support it.
   if (!TLI.isTypeLegal(VT)) {
   // under the assumption that i64 won't be used if the target doesn't
   // support it.
   if (!TLI.isTypeLegal(VT)) {
-    // MVT::i1 is special. Allow AND and OR (but not XOR) because they
+    // MVT::i1 is special. Allow AND, OR, or XOR because they
     // don't require additional zeroing, which makes them easy.
     if (VT == MVT::i1 &&
     // don't require additional zeroing, which makes them easy.
     if (VT == MVT::i1 &&
-        (ISDOpcode == ISD::AND || ISDOpcode == ISD::OR))
+        (ISDOpcode == ISD::AND || ISDOpcode == ISD::OR ||
+         ISDOpcode == ISD::XOR))
       VT = TLI.getTypeToTransformTo(VT);
     else
       return false;
       VT = TLI.getTypeToTransformTo(VT);
     else
       return false;