[ConstantFolding] Extend FoldReinterpretLoadFromConstPtr to handle negative offsets
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 13 Jul 2016 23:33:07 +0000 (23:33 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 13 Jul 2016 23:33:07 +0000 (23:33 +0000)
commitf89660aba78401fab81852c23437509796e8b5eb
tree65ef0ca0862d2520aed5ffdb2b013502344625c4
parentd77a3b61eba36bdd4c9585e5dfa3f779194d21c4
[ConstantFolding] Extend FoldReinterpretLoadFromConstPtr to handle negative offsets

Treat loads which clip before the start of a global initializer the same
way we treat clipping beyond the end of the initializer: use zeros.

llvm-svn: 275345
llvm/lib/Analysis/ConstantFolding.cpp
llvm/test/Transforms/InstSimplify/load.ll