[llvm-commits] [PATCH] PR14753: LICM fix to cleanup preheader loads.
atrick at apple.com
Fri Jan 4 17:59:04 PST 2013
On Jan 4, 2013, at 5:51 PM, Chris Lattner <clattner at apple.com> wrote:
> On Jan 4, 2013, at 3:30 PM, Andrew Trick <atrick at apple.com> wrote:
>> I think this is a reasonable fix for PR14753: Should recognize memset loop with a global induction variable.
>> I'm teaching LICM to cleanup its hoisted loads so that the resulting phis look like induction variables. This works around the fact that we only invoke GVN once after all loop opts. We don't call it between loop passes and we have no incremental GVN.
> Andy and I spoke about this in person. I like that LICM does a scan to find a loaded value when promoting, but don't think the PHI node check should be there, and would love for the scanning logic to be unified into "FindAvailableLoadedValue" in lib/Analysis/Loads.cpp.
Right, removing the redundant load is generally good if we're willing to always attempt to FindAvailableLoadedValue.
The phi check was to limit the scan to cases in which the optimization actually benefits the current loop, not just the outer loop. It's complexity we don't need.
More information about the llvm-commits