aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/NaCl/PNaClABISimplify.cpp
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-06-29 17:56:31 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-06-29 17:56:31 -0700
commit7e6b35b1f14efaa250dfcf9d90aba90fda227ba4 (patch)
treeaa2ffebf7b6df616a312d1d847be27103b910338 /lib/Transforms/NaCl/PNaClABISimplify.cpp
parentf2518db25a8d0cacebb82d2f8872b00014a03bc8 (diff)
PNaCl ABI: Remove use of @llvm.memset.p0i8.i64 (64-bit intrinsic variant)
Convert calls to this intrinsic to use the 32-bit variant instead. Do the same for the memcpy and memmove intrinsics too. Change the PNaCl ABI verifier to check this argument. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3530 TEST=*.ll tests + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/18226003
Diffstat (limited to 'lib/Transforms/NaCl/PNaClABISimplify.cpp')
-rw-r--r--lib/Transforms/NaCl/PNaClABISimplify.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp
index 056b0ae651..81fce8ce13 100644
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp
@@ -67,6 +67,11 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) {
PM.add(createPromoteI1OpsPass());
+ // Optimization passes and ExpandByVal introduce
+ // memset/memcpy/memmove intrinsics with a 64-bit size argument.
+ // This pass converts those arguments to 32-bit.
+ PM.add(createCanonicalizeMemIntrinsicsPass());
+
// We place StripMetadata after optimization passes because
// optimizations depend on the metadata.
PM.add(createStripMetadataPass());