LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 420 - [licm] LICM invalidates alias analysis info and uses broken information
Summary: [licm] LICM invalidates alias analysis info and uses broken information
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: 1.3
Hardware: All All
: P normal
Assignee: Chris Lattner
URL:
Keywords: compile-fail
: 439 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-15 12:19 PDT by Chris Lattner
Modified: 2010-02-22 12:51 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
Testcase that causes the crash (3.47 KB, text/plain)
2004-08-15 12:22 PDT, Chris Lattner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2004-08-15 12:19:53 PDT
gccld on 253.perlbmk crashes when run on persephone, because the LICM pass is
promoting a memory location out of a loop, and not updating the alias analysis.

The problem is that LICM uses a call to PromoteMemToReg to do all of the heavy
lifting and insertion of PHI nodes.  Unfortunately, this causes some reasonably
large churn to the code and the alias analysis impl (glocalsmodref-aa in this
case) is not informed.  Later, the stale information is used by LICM and a crash
results.

I will attach a reduced testcase for the problem.

-Chris
Comment 1 Chris Lattner 2004-08-15 12:22:12 PDT
Created attachment 164 [details]
Testcase that causes the crash

Reproduce the problem with:

llvm-as bugpoint-reduced-simplified.ll
valgrind opt bugpoint-reduced-simplified.bc -globalsmodref-aa -licm
-disable-output

-Chris
Comment 2 Chris Lattner 2004-09-14 12:14:32 PDT
Here is a reduced testcase:

----
%PL_regcomp_parse = internal global sbyte* null

implementation

void %test() {
        br label %Outer
Outer:
        br label %Inner
Inner:
	%tmp.114.i.i.i = load sbyte** %PL_regcomp_parse
	%tmp.115.i.i.i = load sbyte* %tmp.114.i.i.i

	store sbyte* null, sbyte** %PL_regcomp_parse

        br bool false, label %Inner, label %Next
Next:
        br bool false, label %Outer, label %Exit
Exit:
        ret void
}

----

$ llvm-as < PR420.ll | valgrind opt -globalsmodref-aa -licm -disable-output

Comment 3 Chris Lattner 2004-09-14 20:05:24 PDT
*** Bug 439 has been marked as a duplicate of this bug. ***
Comment 4 Chris Lattner 2004-09-14 20:07:22 PDT
This is now fixed, testcase here:
test/Regression/Transforms/LICM/2004-09-14-AliasAnalysisInvalidate.llx

Patches here:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040913/018323.html
...
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040913/018328.html

-Chris