diff options
-rw-r--r-- | lib/Target/JSBackend/JSBackend.cpp | 6 |
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); |