aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2012-12-14 17:55:15 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2012-12-14 17:55:15 +0000
commit6aed25d93d1cfcde5809a73ffa7dc1b0d6396f66 (patch)
tree57e2fdf1caf960d8d878e0289f32af6759832b49 /lib/Transforms
parent7139cfb19b1cc28dfd5e274c07ec68835bc6d6d6 (diff)
parent1ad9253c9d34ccbce3e7e4ea5d87c266cbf93410 (diff)
Updating branches/google/stable to r169803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/stable@170212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Hello/Hello.cpp4
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp36
-rw-r--r--lib/Transforms/IPO/ConstantMerge.cpp10
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp32
-rw-r--r--lib/Transforms/IPO/ExtractGV.cpp6
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp18
-rw-r--r--lib/Transforms/IPO/GlobalDCE.cpp4
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp86
-rw-r--r--lib/Transforms/IPO/IPConstantPropagation.cpp6
-rw-r--r--lib/Transforms/IPO/InlineAlways.cpp70
-rw-r--r--lib/Transforms/IPO/InlineSimple.cpp11
-rw-r--r--lib/Transforms/IPO/Inliner.cpp18
-rw-r--r--lib/Transforms/IPO/Internalize.cpp6
-rw-r--r--lib/Transforms/IPO/LoopExtractor.cpp6
-rw-r--r--lib/Transforms/IPO/MergeFunctions.cpp12
-rw-r--r--lib/Transforms/IPO/PartialInlining.cpp6
-rw-r--r--lib/Transforms/IPO/PassManagerBuilder.cpp20
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp14
-rw-r--r--lib/Transforms/IPO/StripDeadPrototypes.cpp4
-rw-r--r--lib/Transforms/IPO/StripSymbols.cpp6
-rw-r--r--lib/Transforms/InstCombine/InstCombine.h9
-rw-r--r--lib/Transforms/InstCombine/InstCombineAndOrXor.cpp27
-rw-r--r--lib/Transforms/InstCombine/InstCombineCalls.cpp32
-rw-r--r--lib/Transforms/InstCombine/InstCombineCasts.cpp2
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp25
-rw-r--r--lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp29
-rw-r--r--lib/Transforms/InstCombine/InstCombineMulDivRem.cpp69
-rw-r--r--lib/Transforms/InstCombine/InstCombinePHI.cpp4
-rw-r--r--lib/Transforms/InstCombine/InstCombineSelect.cpp2
-rw-r--r--lib/Transforms/InstCombine/InstCombineShifts.cpp173
-rw-r--r--lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp102
-rw-r--r--lib/Transforms/InstCombine/InstCombineWorklist.h6
-rw-r--r--lib/Transforms/InstCombine/InstructionCombining.cpp44
-rw-r--r--lib/Transforms/Instrumentation/AddressSanitizer.cpp474
-rw-r--r--lib/Transforms/Instrumentation/BlackList.cpp39
-rw-r--r--lib/Transforms/Instrumentation/BlackList.h1
-rw-r--r--lib/Transforms/Instrumentation/BoundsChecking.cpp17
-rw-r--r--lib/Transforms/Instrumentation/CMakeLists.txt1
-rw-r--r--lib/Transforms/Instrumentation/EdgeProfiling.cpp4
-rw-r--r--lib/Transforms/Instrumentation/GCOVProfiling.cpp43
-rw-r--r--lib/Transforms/Instrumentation/Instrumentation.cpp2
-rw-r--r--lib/Transforms/Instrumentation/MaximumSpanningTree.h4
-rw-r--r--lib/Transforms/Instrumentation/MemorySanitizer.cpp1579
-rw-r--r--lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp16
-rw-r--r--lib/Transforms/Instrumentation/PathProfiling.cpp8
-rw-r--r--lib/Transforms/Instrumentation/ThreadSanitizer.cpp169
-rw-r--r--lib/Transforms/Scalar/ADCE.cpp8
-rw-r--r--lib/Transforms/Scalar/BasicBlockPlacement.cpp4
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp49
-rw-r--r--lib/Transforms/Scalar/ConstantProp.cpp6
-rw-r--r--lib/Transforms/Scalar/CorrelatedValuePropagation.cpp6
-rw-r--r--lib/Transforms/Scalar/DCE.cpp4
-rw-r--r--lib/Transforms/Scalar/DeadStoreElimination.cpp20
-rw-r--r--lib/Transforms/Scalar/EarlyCSE.cpp14
-rw-r--r--lib/Transforms/Scalar/GVN.cpp12
-rw-r--r--lib/Transforms/Scalar/GlobalMerge.cpp4
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp22
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp41
-rw-r--r--lib/Transforms/Scalar/LICM.cpp24
-rw-r--r--lib/Transforms/Scalar/LoopDeletion.cpp6
-rw-r--r--lib/Transforms/Scalar/LoopIdiomRecognize.cpp543
-rw-r--r--lib/Transforms/Scalar/LoopInstSimplify.cpp8
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp14
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp24
-rw-r--r--lib/Transforms/Scalar/LoopUnrollPass.cpp6
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp22
-rw-r--r--lib/Transforms/Scalar/MemCpyOptimizer.cpp10
-rw-r--r--lib/Transforms/Scalar/ObjCARC.cpp56
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp130
-rw-r--r--lib/Transforms/Scalar/Reg2Mem.cpp10
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp24
-rw-r--r--lib/Transforms/Scalar/SROA.cpp813
-rw-r--r--lib/Transforms/Scalar/Scalar.cpp8
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp14
-rw-r--r--lib/Transforms/Scalar/SimplifyCFGPass.cpp14
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp1056
-rw-r--r--lib/Transforms/Scalar/Sink.cpp6
-rw-r--r--lib/Transforms/Scalar/TailRecursionElimination.cpp18
-rw-r--r--lib/Transforms/Utils/AddrModeMatcher.cpp6
-rw-r--r--lib/Transforms/Utils/BasicBlockUtils.cpp14
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp8
-rw-r--r--lib/Transforms/Utils/BuildLibCalls.cpp77
-rw-r--r--lib/Transforms/Utils/BypassSlowDivision.cpp6
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp14
-rw-r--r--lib/Transforms/Utils/CloneModule.cpp8
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp16
-rw-r--r--lib/Transforms/Utils/DemoteRegToStack.cpp2
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp33
-rw-r--r--lib/Transforms/Utils/IntegerDivision.cpp4
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp14
-rw-r--r--lib/Transforms/Utils/Local.cpp16
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp24
-rw-r--r--lib/Transforms/Utils/LoopUnroll.cpp2
-rw-r--r--lib/Transforms/Utils/LoopUnrollRuntime.cpp2
-rw-r--r--lib/Transforms/Utils/LowerExpectIntrinsic.cpp4
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp8
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp4
-rw-r--r--lib/Transforms/Utils/Mem2Reg.cpp8
-rw-r--r--lib/Transforms/Utils/MetaRenamer.cpp4
-rw-r--r--lib/Transforms/Utils/PromoteMemoryToRegister.cpp24
-rw-r--r--lib/Transforms/Utils/SSAUpdater.cpp8
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp80
-rw-r--r--lib/Transforms/Utils/SimplifyIndVar.cpp10
-rw-r--r--lib/Transforms/Utils/SimplifyInstructions.cpp8
-rw-r--r--lib/Transforms/Utils/SimplifyLibCalls.cpp1073
-rw-r--r--lib/Transforms/Utils/UnifyFunctionExitNodes.cpp4
-rw-r--r--lib/Transforms/Vectorize/BBVectorize.cpp153
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp2277
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.h458
-rw-r--r--lib/Transforms/Vectorize/Vectorize.cpp8
110 files changed, 7014 insertions, 3615 deletions
diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp
index b0e22de8d7..d0b146b4e9 100644
--- a/lib/Transforms/Hello/Hello.cpp
+++ b/lib/Transforms/Hello/Hello.cpp
@@ -13,10 +13,10 @@
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "hello"
-#include "llvm/Pass.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Function.h"
+#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/ADT/Statistic.h"
using namespace llvm;
STATISTIC(HelloCounter, "Counts number of functions greeted");
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 8a0274b5ff..2132e0a5fe 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -31,21 +31,21 @@
#define DEBUG_TYPE "argpromotion"
#include "llvm/Transforms/IPO.h"
+#include "llvm/ADT/DepthFirstIterator.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/Analysis/AliasAnalysis.h"
+#include "llvm/Analysis/CallGraph.h"
+#include "llvm/CallGraphSCCPass.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
-#include "llvm/Module.h"
-#include "llvm/CallGraphSCCPass.h"
#include "llvm/Instructions.h"
#include "llvm/LLVMContext.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/Module.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Support/CallSite.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/ADT/DepthFirstIterator.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/StringExtras.h"
#include <set>
using namespace llvm;
@@ -515,12 +515,12 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// that we are *not* promoting. For the ones that we do promote, the parameter
// attributes are lost
SmallVector<AttributeWithIndex, 8> AttributesVec;
- const AttrListPtr &PAL = F->getAttributes();
+ const AttributeSet &PAL = F->getAttributes();
// Add any return attributes.
Attributes attrs = PAL.getRetAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex,
+ AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex,
attrs));
// First, determine the new argument list
@@ -593,7 +593,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any function attributes.
attrs = PAL.getFnAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
+ AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex,
attrs));
Type *RetTy = FTy->getReturnType();
@@ -611,7 +611,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Recompute the parameter attributes list based on the new arguments for
// the function.
- NF->setAttributes(AttrListPtr::get(AttributesVec));
+ NF->setAttributes(AttributeSet::get(F->getContext(), AttributesVec));
AttributesVec.clear();
F->getParent()->getFunctionList().insert(F, NF);
@@ -636,12 +636,12 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
CallSite CS(F->use_back());
assert(CS.getCalledFunction() == F);
Instruction *Call = CS.getInstruction();
- const AttrListPtr &CallPAL = CS.getAttributes();
+ const AttributeSet &CallPAL = CS.getAttributes();
// Add any return attributes.
Attributes attrs = CallPAL.getRetAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::ReturnIndex,
+ AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::ReturnIndex,
attrs));
// Loop over the operands, inserting GEP and loads in the caller as
@@ -723,7 +723,7 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
// Add any function attributes.
attrs = CallPAL.getFnAttributes();
if (attrs.hasAttributes())
- AttributesVec.push_back(AttributeWithIndex::get(AttrListPtr::FunctionIndex,
+ AttributesVec.push_back(AttributeWithIndex::get(AttributeSet::FunctionIndex,
attrs));
Instruction *New;
@@ -731,11 +731,13 @@ CallGraphNode *ArgPromotion::DoPromotion(Function *F,
New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
Args, "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setAttributes(AttrListPtr::get(AttributesVec));
+ cast<InvokeInst>(New)->setAttributes(AttributeSet::get(II->getContext()