[llvm-bugs] [Bug 26428] New: LICM: Ignore loop exits which don't exit on first iteration when computing isGuaranteedToExecute

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 1 18:41:24 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26428

            Bug ID: 26428
           Summary: LICM: Ignore loop exits which don't exit on first
                    iteration when computing isGuaranteedToExecute
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: listmail at philipreames.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

When computing the isGuaranteedToExecute predicate in LICM (used for satisfying
dereferenceability and memory model legality questions), we can ignore any
exiting blocks where the exit condition is known not to exit on the first
iteration.  

A motivating example might be something like this:
sum = 0;
for (int i = 0; i < 100; i++)
  if (i > 20) break;
  // g_idx is a global and doesn't alias a
  sum += a[g_idx]
}

We can hoist the load of g_idx out of the loop even if we don't know that g_idx
is dereferenceable since doing so can not change the location of a fault. 
Specifically, we know that the loop exit can't be taken on the first iteration
since (0 > 20) == false.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160202/101b3e41/attachment-0001.html>


More information about the llvm-bugs mailing list