aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gccld
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gccld')
-rw-r--r--tools/gccld/GenerateCode.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index 982a7e3..d2c0f3d 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -111,6 +111,10 @@ GenerateBytecode (Module *M, bool Strip, bool Internalize, std::ostream *Out) {
if (!DisableInline)
addPass(Passes, createFunctionInliningPass()); // Inline small functions
+ // If we didn't decide to inline a function, check to see if we can
+ // transform it to pass arguments by value instead of by reference.
+ addPass(Passes, createArgumentPromotionPass());
+
// The IPO passes may leave cruft around. Clean up after them.
addPass(Passes, createInstructionCombiningPass());