aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@mozilla.com>2014-03-04 21:30:15 -0800
committerDan Gohman <sunfish@mozilla.com>2014-03-04 21:30:15 -0800
commitc6f3be7a4da7ba2f94dcbd3b442147807b558b99 (patch)
tree1b6cdcfac88f4400566b5071b00504843e7c27a4
parentba1f9a0611a385a9e43daae5765abb2eb3511c01 (diff)
Don't run calculateNativizedVars at -O1 and higher.
-rw-r--r--lib/Target/JSBackend/JSBackend.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Target/JSBackend/JSBackend.cpp b/lib/Target/JSBackend/JSBackend.cpp
index 56e125c3f3..92d562a1df 100644
--- a/lib/Target/JSBackend/JSBackend.cpp
+++ b/lib/Target/JSBackend/JSBackend.cpp
@@ -1849,7 +1849,11 @@ void JSWriter::printFunction(const Function *F) {
UsedVars.clear();
UniqueNum = 0;
- calculateNativizedVars(F);
+
+ // When optimizing, the regular optimizer (mem2reg, SROA, GVN, and others)
+ // will have already taken all the opportunities for nativization.
+ if (OptLevel == CodeGenOpt::None)
+ calculateNativizedVars(F);
// Do alloca coloring at -O1 and higher.
Allocas.analyze(*F, *DL, OptLevel != CodeGenOpt::None);