projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa522ca
)
GVN-hoist: add missing check for all GEP operands available
author
Sebastian Pop
<sebpop@gmail.com>
Thu, 21 Jul 2016 23:32:39 +0000
(23:32 +0000)
committer
Sebastian Pop
<sebpop@gmail.com>
Thu, 21 Jul 2016 23:32:39 +0000
(23:32 +0000)
llvm-svn: 276364
llvm/lib/Transforms/Scalar/GVNHoist.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
index
ad373ba
..
c420089
100644
(file)
--- a/
llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ b/
llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@
-613,6
+613,9
@@
public:
// Also copy Val when it is a GEP.
if (Val && isa<GetElementPtrInst>(Val)) {
+ // Check whether we can compute the GEP at HoistPt.
+ if (!allOperandsAvailable(Val, HoistPt))
+ return false;
Instruction *ClonedVal = Val->clone();
ClonedVal->insertBefore(HoistPt->getTerminator());
// Conservatively discard any optimization hints, they may differ on the