[PATCH] Fix bug in load PRE in GVN.cpp

Akira Hatanaka ahatanak at gmail.com
Fri Apr 25 11:37:18 PDT 2014

This patch fixes GVN::AnalyzeLoadAvailability to pass the phi-translated
pointer address of the load instruction that is processed instead of the
untranslated address to AnalyzeLoadFromClobberingLoad.

Without the fix, GVN::AnalyzeLoadAvailability incorrectly determines a load
value is available or unavailable in a basic block, which causes load-PRE
to incorrectly determine a load is partially redundant when it isn't (see
first function in test case) or it isn't partially redundant when it is
(second function in test case).

I tested this patch running the test suite and didn't see any failing tests.


Please review.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140425/3b017879/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gvn-loadpre1.patch
Type: application/octet-stream
Size: 3963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140425/3b017879/attachment.obj>

More information about the llvm-commits mailing list