llvm-6502/lib
Hal Finkel b9ce60ff09 [BasicAA] Revert "Revert r218714 - Make better use of zext and sign information."
This reverts r218944, which reverted r218714, plus a bug fix.

Description of the bug in r218714 (by Nick)

The original patch forgot to check if the Scale in VariableGEPIndex flipped the
sign of the variable. The BasicAA pass iterates over the instructions in the
order they appear in the function, and so BasicAliasAnalysis::aliasGEP is
called with the variable it first comes across as parameter GEP1. Adding a
%reorder label puts the definition of %a after %b so aliasGEP is called with %b
as the first parameter and %a as the second. aliasGEP later calculates that %a
== %b + 1 - %idxprom where %idxprom >= 0 (if %a was passed as the first
parameter it would calculate %b == %a - 1 + %idxprom where %idxprom >= 0) -
ignoring that %idxprom is scaled by -1 here lead the patch to incorrectly
conclude that %a > %b.

Revised patch by Nick White, thanks! Thanks to Lang to isolating the bug.
Slightly modified by me to add an early exit from the loop and avoid
unnecessary, but expensive, function calls.

Original commit message:

Two related things:

 1. Fixes a bug when calculating the offset in GetLinearExpression. The code
    previously used zext to extend the offset, so negative offsets were converted
    to large positive ones.

 2. Enhance aliasGEP to deduce that, if the difference between two GEP
    allocations is positive and all the variables that govern the offset are also
    positive (i.e. the offset is strictly after the higher base pointer), then
    locations that fit in the gap between the two base pointers are NoAlias.

Patch by Nick White!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219135 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-06 18:37:59 +00:00
..
Analysis [BasicAA] Revert "Revert r218714 - Make better use of zext and sign information." 2014-10-06 18:37:59 +00:00
AsmParser
Bitcode
CodeGen DbgValueHistoryCalculator: Store modified registers in a BitVector instead of std::set. 2014-10-06 15:31:04 +00:00
DebugInfo Refactor RelocVisitor to take an object. This removes some 2014-10-06 06:55:55 +00:00
ExecutionEngine
IR [PM] Remove an unused and rather expensive mapping from an analysis 2014-10-06 00:30:59 +00:00
IRReader
LineEditor
Linker
LTO
MC MachObjectWriter: optimize the string table for common suffices 2014-10-06 17:05:19 +00:00
Object
Option
ProfileData Eliminate some deep std::vector copies. NFC. 2014-10-03 18:33:16 +00:00
Support Make the MD5 result name consistent between functions, header and source. 2014-10-06 13:48:07 +00:00
TableGen Eliminate some deep std::vector copies. NFC. 2014-10-03 18:33:16 +00:00
Target ARM: silence unused variable warning 2014-10-06 17:26:36 +00:00
Transforms Give the Reassociate pass a bit more flexibility and autonomy when optimizing expressions. 2014-10-05 23:41:26 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile