From 26af2cae05f4a8f5a66f5ef0f5d107fef174a7f3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 28 Jan 2014 02:38:36 +0000 Subject: 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 --- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp') 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 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. -- cgit v1.2.3