[llvm-bugs] [Bug 48709] New: Miscompile due to BasicAA/ValueTracking using wrong DT

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 11 02:48:47 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=48709

            Bug ID: 48709
           Summary: Miscompile due to BasicAA/ValueTracking using wrong DT
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Global Analyses
          Assignee: bjorn.a.pettersson at ericsson.com
          Reporter: bjorn.a.pettersson at ericsson.com
                CC: llvm-bugs at lists.llvm.org

After merging patches that used DominatorTree information in more places in
BasicAA/ValueTracking (such as
https://reviews.llvm.org/rGb21840751278128ef6942074ae89ea63c9c6ac58) we started
to see miscompiles downstream for our OOT target.

By adding a DT->verify() check before every use of DT in BasicAliasAnalysis and
VelueTracking it turned out that lots of lit tests would complain also in-tree.
So it is assumed that one could get miscompiles also for other targets, as
using an invalid DominatorTree during analysis could be dangerous.

Early analysis show that problem is related to the calculation of "last user"
in the legacy pass manager. Sometimes the FunctionAliasAnalysis (and BasicAA)
is preserved and kept for a longer time compared to the DominatorTree, possibly
due to not using "addRequiredTransitive" when specifying pass dependencies for
the chained analysis usage.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210111/9033a577/attachment.html>


More information about the llvm-bugs mailing list