Make DataLayout Non-Optional in the Module
authorMehdi Amini <mehdi.amini@apple.com>
Wed, 4 Mar 2015 18:43:29 +0000 (18:43 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Wed, 4 Mar 2015 18:43:29 +0000 (18:43 +0000)
commitc94da20917cb4dfa750903b366c920210c5265ee
treeac5750ee076e875d626663739037b59c82f565de
parent2337c1fd835fd7b0b890529ec133c81bb71d3b3d
Make DataLayout Non-Optional in the Module

Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

Differential Revision: http://reviews.llvm.org/D7992

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231270 91177308-0d34-0410-b5e6-96231b3b80d8
163 files changed:
examples/ExceptionDemo/ExceptionDemo.cpp
examples/Kaleidoscope/Chapter4/toy.cpp
examples/Kaleidoscope/Chapter5/toy.cpp
examples/Kaleidoscope/Chapter6/toy.cpp
examples/Kaleidoscope/Chapter7/toy.cpp
examples/Kaleidoscope/Chapter8/toy.cpp
examples/Kaleidoscope/Orc/fully_lazy/toy.cpp
examples/Kaleidoscope/Orc/initial/toy.cpp
examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
include/llvm/Analysis/AliasAnalysis.h
include/llvm/Analysis/LibCallAliasAnalysis.h
include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
include/llvm/IR/DataLayout.h
include/llvm/IR/Module.h
include/llvm/Transforms/Utils/Cloning.h
lib/Analysis/AliasAnalysis.cpp
lib/Analysis/AliasAnalysisCounter.cpp
lib/Analysis/AliasDebugger.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CFLAliasAnalysis.cpp
lib/Analysis/IPA/GlobalsModRef.cpp
lib/Analysis/IPA/InlineCost.cpp
lib/Analysis/IVUsers.cpp
lib/Analysis/LazyValueInfo.cpp
lib/Analysis/LibCallAliasAnalysis.cpp
lib/Analysis/Lint.cpp
lib/Analysis/Loads.cpp
lib/Analysis/LoopAccessAnalysis.cpp
lib/Analysis/MemDerefPrinter.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Analysis/NoAliasAnalysis.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
lib/Analysis/ScopedNoAliasAA.cpp
lib/Analysis/TargetTransformInfo.cpp
lib/Analysis/TypeBasedAliasAnalysis.cpp
lib/CodeGen/WinEHPrepare.cpp
lib/ExecutionEngine/MCJIT/MCJIT.cpp
lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
lib/IR/DataLayout.cpp
lib/IR/Module.cpp
lib/LTO/LTOCodeGenerator.cpp
lib/LTO/LTOModule.cpp
lib/Linker/LinkModules.cpp
lib/Object/IRObjectFile.cpp
lib/Target/CppBackend/CPPBackend.cpp
lib/Target/NVPTX/NVPTXAllocaHoisting.h
lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp
lib/Target/NVPTX/NVPTXLowerAggrCopies.h
lib/Target/PowerPC/PPCCTRLoops.cpp
lib/Target/PowerPC/PPCLoopDataPrefetch.cpp
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp
lib/Target/R600/AMDGPUPromoteAlloca.cpp
lib/Target/Target.cpp
lib/Target/TargetMachineC.cpp
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/IPO/LowerBitSets.cpp
lib/Transforms/IPO/MergeFunctions.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/Instrumentation/AddressSanitizer.cpp
lib/Transforms/Instrumentation/BoundsChecking.cpp
lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
lib/Transforms/Instrumentation/MemorySanitizer.cpp
lib/Transforms/Instrumentation/SanitizerCoverage.cpp
lib/Transforms/Instrumentation/ThreadSanitizer.cpp
lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.cpp
lib/Transforms/ObjCARC/ObjCARCAliasAnalysis.h
lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
lib/Transforms/Scalar/BDCE.cpp
lib/Transforms/Scalar/ConstantProp.cpp
lib/Transforms/Scalar/EarlyCSE.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/JumpThreading.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoadCombine.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
lib/Transforms/Scalar/LoopInstSimplify.cpp
lib/Transforms/Scalar/LoopRerollPass.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/SROA.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Scalar/Scalarizer.cpp
lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Scalar/Sink.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/Utils/InlineFunction.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LoopUnroll.cpp
lib/Transforms/Utils/SimplifyInstructions.cpp
lib/Transforms/Vectorize/BBVectorize.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Analysis/Delinearization/a.ll
test/Analysis/Delinearization/himeno_1.ll
test/Analysis/Delinearization/himeno_2.ll
test/Analysis/Delinearization/iv_times_constant_in_subscript.ll
test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_3d.ll
test/Analysis/Delinearization/multidim_ivs_and_integer_offsets_nts_3d.ll
test/Analysis/Delinearization/multidim_ivs_and_parameteric_offsets_3d.ll
test/Analysis/Delinearization/multidim_only_ivs_2d.ll
test/Analysis/Delinearization/multidim_only_ivs_3d.ll
test/Analysis/ScalarEvolution/max-trip-count.ll
test/Bitcode/highLevelStructure.3.2.ll
test/CodeGen/Thumb2/2009-12-01-LoopIVUsers.ll
test/Linker/comdat3.ll [deleted file]
test/Linker/datalayout.ll
test/Other/constant-fold-gep.ll
test/Transforms/ConstantMerge/merge-both.ll
test/Transforms/GlobalOpt/externally-initialized-global-ctr.ll
test/Transforms/IndVarSimplify/2008-09-02-IVType.ll
test/Transforms/IndVarSimplify/2009-04-27-Floating.ll
test/Transforms/IndVarSimplify/iv-widen.ll
test/Transforms/IndVarSimplify/lftr-extend-const.ll
test/Transforms/IndVarSimplify/lftr_simple.ll
test/Transforms/IndVarSimplify/pr20680.ll
test/Transforms/IndVarSimplify/preserve-signed-wrap.ll
test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll
test/Transforms/IndVarSimplify/signed-trip-count.ll
test/Transforms/IndVarSimplify/ult-sub-to-eq.ll
test/Transforms/IndVarSimplify/widen-loop-comp.ll
test/Transforms/Inline/alloca-merge-align-nodl.ll [deleted file]
test/Transforms/Inline/alloca-merge-align.ll
test/Transforms/Inline/lifetime-no-datalayout.ll
test/Transforms/InstCombine/2012-09-24-MemcpyFromGlobalCrash.ll [deleted file]
test/Transforms/InstCombine/extractvalue.ll
test/Transforms/InstCombine/gc.relocate.ll
test/Transforms/InstCombine/load-cmp.ll
test/Transforms/InstCombine/overflow-mul.ll
test/Transforms/InstCombine/pr21651.ll
test/Transforms/InstCombine/simplify-libcalls.ll
test/Transforms/InstCombine/store.ll
test/Transforms/InstCombine/type_pun.ll
test/Transforms/LoopSimplify/preserve-scev.ll
test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll
test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll
test/Transforms/LoopStrengthReduce/2011-10-03-CritEdgeMerge.ll
test/Transforms/LoopStrengthReduce/2011-10-06-ReusePhi.ll
test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll
test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll
test/Transforms/LoopStrengthReduce/X86/2011-07-20-DoubleIV.ll
test/Transforms/LoopStrengthReduce/count-to-zero.ll
test/Transforms/LoopStrengthReduce/dont_reverse.ll
test/Transforms/LoopStrengthReduce/ivchain.ll
test/Transforms/LoopStrengthReduce/nested-reduce.ll
test/Transforms/LoopStrengthReduce/pr12691.ll
test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll
test/Transforms/LoopStrengthReduce/remove_indvar.ll
test/Transforms/LoopStrengthReduce/variable_stride.ll
test/Transforms/PhaseOrdering/scev.ll
test/Transforms/ScalarRepl/2007-11-03-bigendian_apint.ll
test/Transforms/Scalarizer/no-data-layout.ll [deleted file]
tools/llc/llc.cpp
tools/llvm-extract/llvm-extract.cpp
tools/opt/opt.cpp
unittests/IR/IRBuilderTest.cpp
unittests/IR/LegacyPassManagerTest.cpp