diff options
author | Pete Cooper <peter_cooper@apple.com> | 2012-03-13 20:59:56 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2012-03-13 20:59:56 +0000 |
commit | f210b68b41704cb602feffa4ebb334220abda407 (patch) | |
tree | c8f6f273b6f602a81820b739450ce487954a6595 /lib/Transforms/Scalar/CodeGenPrepare.cpp | |
parent | b9153bacd05f4e31f8d841a54ee035abea5b3f41 (diff) | |
download | external_llvm-f210b68b41704cb602feffa4ebb334220abda407.zip external_llvm-f210b68b41704cb602feffa4ebb334220abda407.tar.gz external_llvm-f210b68b41704cb602feffa4ebb334220abda407.tar.bz2 |
Target override to allow CodeGenPrepare to sink address operands to intrinsics in the same way it current does for loads and stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index aad3a92..020ec57 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -579,6 +579,15 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) { return true; } + if (II && TLI) { + SmallVector<Value*, 2> PtrOps; + Type *AccessTy; + if (TLI->GetAddrModeArguments(II, PtrOps, AccessTy)) + while (!PtrOps.empty()) + if (OptimizeMemoryInst(II, PtrOps.pop_back_val(), AccessTy)) + return true; + } + // From here on out we're working with named functions. if (CI->getCalledFunction() == 0) return false; |