From 614c108c60ef2ea51d0e5d4db871a5d954f4ecda Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Wed, 29 May 2013 22:47:23 -0700 Subject: PNaCl: Add ExpandSmallArguments pass to widen parameters to 32 bits This widens i1, i8 and i16 function arguments and return types. Factor out RecreateFunction() helper function from existing PNaCl passes since this is a reoccurring code fragment. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3342 TEST=*.ll tests + PNaCl toolchain trybots + GCC torture tests + LLVM test suite Review URL: https://codereview.chromium.org/15971007 --- lib/Transforms/NaCl/PNaClABISimplify.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Transforms/NaCl/PNaClABISimplify.cpp') diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp index 47e5fb67e6..3c59546275 100644 --- a/lib/Transforms/NaCl/PNaClABISimplify.cpp +++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp @@ -49,6 +49,12 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) { // ExpandByVal expands it to. PM.add(createExpandByValPass()); + // We place ExpandSmallArguments after optimization passes because + // some optimizations undo its changes. Note that + // ExpandSmallArguments requires that ExpandVarArgs has already been + // run. + PM.add(createExpandSmallArgumentsPass()); + // We place StripMetadata after optimization passes because // optimizations depend on the metadata. PM.add(createStripMetadataPass()); -- cgit v1.2.3-70-g09d2