aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-15 01:55:03 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-15 01:55:03 +0000
commitf1a7e6203316ef6f84977ce60075a84a47e6f28d (patch)
tree5931a6783d765238e6b267b0ae389f1bd926c273 /llvm/lib/Analysis/ValueTracking.cpp
parent138551bb15f2a67cc498546a08df3103fea36924 (diff)
downloadllvm-f1a7e6203316ef6f84977ce60075a84a47e6f28d.zip
llvm-f1a7e6203316ef6f84977ce60075a84a47e6f28d.tar.gz
llvm-f1a7e6203316ef6f84977ce60075a84a47e6f28d.tar.bz2
Teach computeKnownBits to look through addrspacecast.
This fixes inferring alignment through an addrspacecast. llvm-svn: 213030
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index bfdc349..cedf076 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -29,6 +29,7 @@
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PatternMatch.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include <cstring>
using namespace llvm;
@@ -415,6 +416,7 @@ void llvm::computeKnownBits(Value *V, APInt &KnownZero, APInt &KnownOne,
break; // Can't work with floating point.
case Instruction::PtrToInt:
case Instruction::IntToPtr:
+ case Instruction::AddrSpaceCast: // Pointers could be different sizes.
// We can't handle these if we don't know the pointer size.
if (!TD) break;
// FALL THROUGH and handle them the same as zext/trunc.