diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-11-21 15:42:31 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-11-21 15:42:31 +0000 |
commit | 02f75f31e0e49fc35a6dc107b0b892e15fdcc3d3 (patch) | |
tree | 5df2086d08f8d5d3dcfd9c7cc3eaa92c26083d6c /llvm/lib/Analysis | |
parent | 87eb9667bf81a0cb713a5910585cf6043ae96b71 (diff) | |
download | bcm5719-llvm-02f75f31e0e49fc35a6dc107b0b892e15fdcc3d3.tar.gz bcm5719-llvm-02f75f31e0e49fc35a6dc107b0b892e15fdcc3d3.zip |
Fix known zero bits for addrspacecast.
Currently LLVM assumes that a pointer addrspacecasted to a different addr space is equivalent to trunc or zext bitwise, which is not true. For example, in amdgcn target, when a null pointer is addrspacecasted from addr space 4 to 0, its value is changed from i64 0 to i32 -1.
This patch teaches LLVM not to assume known bits of addrspacecast instruction to its operand.
Differential Revision: https://reviews.llvm.org/D26803
llvm-svn: 287545
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 18117f66a34..234d42dfa91 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1025,7 +1025,6 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, break; // Can't work with floating point. case Instruction::PtrToInt: case Instruction::IntToPtr: - case Instruction::AddrSpaceCast: // Pointers could be different sizes. // Fall through and handle them the same as zext/trunc. LLVM_FALLTHROUGH; case Instruction::ZExt: |