-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[licm] LICM invalidates alias analysis info and uses broken information #792
Comments
assigned to @lattner |
Here is a reduced testcase: %PL_regcomp_parse = internal global sbyte* null implementation void %test() {
Next: $ llvm-as < llvm/llvm-bugzilla-archive#420 .ll | valgrind opt -globalsmodref-aa -licm -disable-output |
*** Bug llvm/llvm-bugzilla-archive#439 has been marked as a duplicate of this bug. *** |
This is now fixed, testcase here: Patches here: -Chris |
…d variables (llvm#792) In OpenCL, `local`-qualified variables are implicitly considered as static. In order to support it, this PR unblocks code paths related to OpenCL static declarations in `CIRGenDecl.cpp`. Following the approach of LLVM CodeGen, a new class `CIRGenOpenCLRuntime` is added to handle the language hook of creating `local`-qualified variables. The default behavior of this hook is quite simple. It forwards the call to `CGF.buildStaticVarDecl`. So in CIR, the OpenCL local memory representation is equivalent to the one defined by SPIR-LLVM convention: a `cir.global` with `addrspace(local)` and *without initializer*, which corresponds to LLVM `undef` initializer. See check lines in test for more details. A `static global`-qualified variable is also added in the test to exercise the static code path itself.
Extended Description
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
The text was updated successfully, but these errors were encountered: