Remove the code for special-casing byval for fast-isel. SelectionDAG
authorDan Gohman <gohman@apple.com>
Sat, 1 May 2010 02:44:23 +0000 (02:44 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 1 May 2010 02:44:23 +0000 (02:44 +0000)
handles argument lowering anyway, so there's no need for special
casing here.

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

lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index fe5937e1a4d330cce33ebb1053b4f4673b678b44..65c36c1289db18a0bd656dff7ef95b02bb74fa9c 100644 (file)
@@ -59,9 +59,7 @@ static bool isUsedOutsideOfDefiningBlock(const Instruction *I) {
 static bool isOnlyUsedInEntryBlock(const Argument *A, bool EnableFastISel) {
   // With FastISel active, we may be splitting blocks, so force creation
   // of virtual registers for all non-dead arguments.
-  // Don't force virtual registers for byval arguments though, because
-  // fast-isel can't handle those in all cases.
-  if (EnableFastISel && !A->hasByValAttr())
+  if (EnableFastISel)
     return A->use_empty();
 
   const BasicBlock *Entry = A->getParent()->begin();
index 4fc28058269d60d16d6ed98cae080aea6657d036..f48fdfc05ca642b6df508d9277b197f032bd1225 100644 (file)
@@ -732,31 +732,15 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
     BasicBlock::const_iterator BI = Begin;
 
     // Lower any arguments needed in this block if this is the entry block.
-    bool SuppressFastISel = false;
-    if (LLVMBB == &Fn.getEntryBlock()) {
+    if (LLVMBB == &Fn.getEntryBlock())
       LowerArguments(LLVMBB);
 
-      // If any of the arguments has the byval attribute, forgo
-      // fast-isel in the entry block.
-      if (FastIS) {
-        unsigned j = 1;
-        for (Function::const_arg_iterator I = Fn.arg_begin(), E = Fn.arg_end();
-             I != E; ++I, ++j)
-          if (Fn.paramHasAttr(j, Attribute::ByVal)) {
-            if (EnableFastISelVerbose || EnableFastISelAbort)
-              dbgs() << "FastISel skips entry block due to byval argument\n";
-            SuppressFastISel = true;
-            break;
-          }
-      }
-    }
-
     // Setup an EH landing-pad block.
     if (BB->isLandingPad())
       PrepareEHLandingPad(BB);
     
     // Before doing SelectionDAG ISel, see if FastISel has been requested.
-    if (FastIS && !SuppressFastISel) {
+    if (FastIS) {
       // Emit code for any incoming arguments. This must happen before
       // beginning FastISel on the entry block.
       if (LLVMBB == &Fn.getEntryBlock()) {