[llvm] r253696 - Revert "[FunctionAttrs] Remove redundant assignment."

Tilmann Scheller via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 20 11:17:11 PST 2015


Author: tilmann
Date: Fri Nov 20 13:17:10 2015
New Revision: 253696

URL: http://llvm.org/viewvc/llvm-project?rev=253696&view=rev
Log:
Revert "[FunctionAttrs] Remove redundant assignment."

This reverts r253661.

Turns out that the assignment is not redundant (despite the Clang static analyzer claiming the opposite).

The variable is being used by the lambda function AddUsersToWorklistIfCapturing().

Modified:
    llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp

Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=253696&r1=253695&r2=253696&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Fri Nov 20 13:17:10 2015
@@ -486,6 +486,8 @@ determinePointerReadAttrs(Argument *A,
         return Attribute::None;
       }
 
+      Captures &= !CS.doesNotCapture(UseIndex);
+
       // Since the optimizer (by design) cannot see the data flow corresponding
       // to a operand bundle use, these cannot participate in the optimistic SCC
       // analysis.  Instead, we model the operand bundle uses as arguments in




More information about the llvm-commits mailing list