From c6f3be7a4da7ba2f94dcbd3b442147807b558b99 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 4 Mar 2014 21:30:15 -0800 Subject: Don't run calculateNativizedVars at -O1 and higher. --- lib/Target/JSBackend/JSBackend.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-18-g5258