http://llvm.org/bugs/show_bug.cgi?id=15777

            Bug ID: 15777
           Summary: SROA::performScalarRepl comment claims to work on all
                    alloca's in function, but it only add ones in the
                    entry block
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Here is the code snippet that I am confused about:
...
// performScalarRepl - This algorithm is a simple worklist driven algorithm,
// which runs on all of the alloca instructions in the function, removing them
// if they are only used by getelementptr instructions.
//
bool SROA::performScalarRepl(Function &F) {
  std::vector<AllocaInst*> WorkList;

  // Scan the entry basic block, adding allocas to the worklist.
  BasicBlock &BB = F.getEntryBlock();
  for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
    if (AllocaInst *A = dyn_cast<AllocaInst>(I))
      WorkList.push_back(A);
...

Is it a code bug in that we are supposed to add all alloca's in the function to
the worklist?  Or is this a comment bug, or something else that I am missing.

Would there be any reason to only allow alloca's in the entry block to be
optimized?  I played around with adding all, and it fixed the optimization bug
I was seeing.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to