summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-01-28 02:38:36 +0000
committerReid Kleckner <reid@kleckner.net>2014-01-28 02:38:36 +0000
commit26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3 (patch)
treea65d86dd391f8685236fb16cf2046d4603833099 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp
parent020acd88ecc4b99632b6af54e7e7f77ab70b4a30 (diff)
downloadbcm5719-llvm-26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3.tar.gz
bcm5719-llvm-26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3.zip
Update optimization passes to handle inalloca arguments
Summary: I searched Transforms/ and Analysis/ for 'ByVal' and updated those call sites to check for inalloca if appropriate. I added tests for any change that would allow an optimization to fire on inalloca. Reviewers: nlewycky Differential Revision: http://llvm-reviews.chandlerc.com/D2449 llvm-svn: 200281
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionAttrs.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
index ea664506da2..92d2f79fa73 100644
--- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -414,6 +414,10 @@ determinePointerReadAttrs(Argument *A,
SmallSet<Use*, 32> Visited;
int Count = 0;
+ // inalloca arguments are always clobbered by the call.
+ if (A->hasInAllocaAttr())
+ return Attribute::None;
+
bool IsRead = false;
// We don't need to track IsWritten. If A is written to, return immediately.
OpenPOWER on IntegriCloud