projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
478b3b4
)
Allow hoisting loads of globals and alloca's in conditionals.
author
Chris Lattner
<sabre@nondot.org>
Mon, 29 Nov 2004 21:26:12 +0000
(21:26 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Mon, 29 Nov 2004 21:26:12 +0000
(21:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18363
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/LICM.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/LICM.cpp
b/lib/Transforms/Scalar/LICM.cpp
index e9f2b330eefbb04dfc58f4ea5d11cd30ee7ac0bf..c20e179f1071ee83caac5129ad45fece88857858 100644
(file)
--- a/
lib/Transforms/Scalar/LICM.cpp
+++ b/
lib/Transforms/Scalar/LICM.cpp
@@
-592,6
+592,12
@@
bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) {
if (Inst.getParent() == CurLoop->getHeader())
return true;
+ // It's always safe to load from a global or alloca.
+ if (isa<LoadInst>(Inst))
+ if (isa<AllocationInst>(Inst.getOperand(0)) ||
+ isa<GlobalVariable>(Inst.getOperand(0)))
+ return true;
+
// Get the exit blocks for the current loop.
std::vector<BasicBlock*> ExitBlocks;
CurLoop->getExitBlocks(ExitBlocks);