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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to