OSDN Git Service

[BasicAA] Fix zext & sext handling
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 8 May 2015 18:58:55 +0000 (18:58 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 8 May 2015 18:58:55 +0000 (18:58 +0000)
commit5de99601367aaf09ba1d17cd51478bde5e1b74fe
treebe3beea7721519c3db67ff2530e2b6df4e63c509
parentd3be0003c4b7b3e9b7957cfbfd20373b53326cef
[BasicAA] Fix zext & sext handling

Summary:

There are several unhandled edge cases in BasicAA's GetLinearExpression
method. This changes fixes outstanding issues, including zext / sext of
a constant with the sign bit set, and the refusal to decompose zexts or
sexts of wrapping arithmetic.

Test Plan: Unit tests added in //q.ext.ll//.

Patch by Nick White.

Reviewers: hfinkel, sanjoy

Reviewed By: hfinkel, sanjoy

Subscribers: sanjoy, llvm-commits, hfinkel

Differential Revision: http://reviews.llvm.org/D6682

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236894 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/BasicAliasAnalysis.cpp
test/Analysis/BasicAA/q.bad.ll [new file with mode: 0644]