aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2016-06-23 14:31:31 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2016-06-23 14:31:31 +0000
commit2d3592d481716a095291acf960c5ff381fe667a6 (patch)
treecf8784ed5aa38038c795641fa3ff8f7ad3e83124 /llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
parenta852d695b8919771b35d196221a063a8f974353f (diff)
downloadllvm-2d3592d481716a095291acf960c5ff381fe667a6.zip
llvm-2d3592d481716a095291acf960c5ff381fe667a6.tar.gz
llvm-2d3592d481716a095291acf960c5ff381fe667a6.tar.bz2
[LoopUnrollAnalyzer] Fix a bug in UnrolledInstAnalyzer::visitLoad.
When simplifying a load we need to make sure that the type of the simplified value matches the type of the instruction we're processing. In theory, we can handle casts here as we deal with constant data, but since it's not implemented at the moment, we at least need to bail out. This fixes PR28262. llvm-svn: 273562
Diffstat (limited to 'llvm/lib/Analysis/LoopUnrollAnalyzer.cpp')
-rw-r--r--llvm/lib/Analysis/LoopUnrollAnalyzer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
index b13f631..f59257a 100644
--- a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
+++ b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
@@ -115,7 +115,7 @@ bool UnrolledInstAnalyzer::visitLoad(LoadInst &I) {
// We might have a vector load from an array. FIXME: for now we just bail
// out in this case, but we should be able to resolve and simplify such
// loads.
- if(!CDS->isElementTypeCompatible(I.getType()))
+ if(CDS->getElementType() != I.getType())
return false;
int ElemSize = CDS->getElementType()->getPrimitiveSizeInBits() / 8U;